Sunday, February 03, 2008

System data gathering super mega script

I'm running this script on a Linux box to gather info on the processes it is running, besides, of course, Nagios.
That box was having a problem that sometimes, totally random stuff, the network went down, this particular box has two NICs, but I can access it only thru SSH, so, went the net went down, I lost the box completely.
Ever since I started to run the script, this system stopped having troubles...
An option I have considered was using a software Watchdog, but I'm not that convinced on running one.

# Data gather script (Modified from one found on Internet)
# /root/devel/dataGathering/
# Be sure to run logrotate on $LOG (!)

PS='/bin/ps fuaxww'
NETSTAT='/bin/netstat -na'

${ECHO} "0000000000000000000000000000000" >> ${LOG}
${DATE} >> ${LOG}
${UPTIME} >> ${LOG}
${CAT} /proc/meminfo >> ${LOG}
${PS} >> ${LOG}
${NETSTAT} >> ${LOG}

# EoF #

Labels: , ,


Anonymous Tavita said...

Keep up the good work.

5:53 AM  
Blogger hictio said...

You 2 Dudez! Keep up those insurances, baby!

2:19 PM  

Post a Comment

<< Home