27 Jul 2011

Get serial number from command line

To obtain the serial number of the server from Solaris command line. HP Blades


/usr/sbin/smbios -t 1

On  linux run

dmidecode -t system

07 Jul 2011

Hanging cron jobs

I found a application user that was using cron  to monitor the app every minute of the day.
At 03H10 the logadm would run and rotates cron's log file. On the odd occasion this would occur the same time the app user runs a script vi cron and cause logadm & cron into a dead lock situation and prevent cron & logadm from processing any further requests.

To fix the  problem search for all PIDs & PPIDs associated with logadm and look for the defunct process's. This would normally indicate the offending process.


for PID in $( ps -ef | grep logad[m] | awk '{print $3}')
do
        PIDS="${PID}|${PID}"
done
ps -ef | egrep "${PIDS}"
 BAD_APP 18635 14216   0        - ?           0:00 <defunct>
    root 14216     1   0   Jul 04 ?           0:07 /usr/sbin/cron
     sys 18632 14216   0        - ?           0:00 <defunct>
     sys 19104 14216   0        - ?           0:01 <defunct>
    root 20894 20090   0 11:33:08 pts/25      0:00 egrep 14216|14216
    root 18629 14216   0   Jul 06 ?           0:00 sh -c /usr/sbin/logadm


Running:

# svcs cron
STATE          STIME    FMRI
online         Nov_02   svc:/system/cron:default   

You will notice all looks well and it is not :-(
Restart cron and all the held back jobs will start running again.

# svcadm restart cron