I want to Check processor status- check processor/cpu status and failed/off status so for that I used command prtdiag and want to fetch the cpu status only from that. how can i do that?

  • What is prtdiag part of? A virtual hosting platform? It doesn't seem to be a standard Unix utility. – Andrew Schulman Dec 11 '13 at 7:25
  • @AndrewSchulman: Solaris. – user9517 Dec 11 '13 at 8:59
  • I don't have access to a suitable Solaris system any more but it should be fairly easy to gather the information you want from the prtdiag output using the standard shell tools. – user9517 Dec 11 '13 at 9:01

just use psrinfo.

$ psrinfo 
0       on-line   since 07/21/2013 05:13:26
1       on-line   since 07/21/2013 05:13:24

however if you really want to check processor state then use either kstat or a correct system call thus :

System Calls                                    processor_info(2)

     processor_info - determine type and status of a processor

     #include <sys/types.h>
     #include <sys/processor.h>

     int        processor_info(processorid_t         processorid,
     processor_info_t *infop);

     The processor_info() function returns the status of the pro-
     cessor  specified  by  processorid  in  the processor_info_t
     structure pointed to by infop.

     The  structure  processor_info_t  contains   the   following

     int      pi_state;
     char     pi_processor_type[PI_TYPELEN];
     char     pi_fputypes[PI_FPUTYPE];
     int      pi_clock;

     The pi_state member is the current state of  the  processor,

     The pi_processor_type  member  is  a  null-terminated  ASCII
     string specifying the type of the processor.

     The pi_fputypes member is  a  null-terminated  ASCII  string
     containing the comma-separated types of floating-point units
     (FPUs) attached to the processor. This string will be  empty
     if no FPU is attached.

     The pi_clock member is the processor clock frequency rounded
     to the nearest megahertz. It may be  0 if not known.

     Upon successful completion, 0 is returned. Otherwise,  -1 is
     returned and  errno is set to indicate the error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.