Hey Guys,
I have been playing around with a custom script to monitor AIX Processes. Basically I give the script a list of process names to grep for and it returns the number of processes found. (See Script Below) That part is working great. Now the problem appears when i want to alert off that data.
The data is all captured in one component so it comes back as
Message.Process1:root
Statistic.Process1:5
Message.Process2:cron
Statistic.Process2:1
Now I need an alert that says for root if less than 5 processes appear send an alert, for cron if less than 1 process appears send an alarm. I assume I need to choose APM: Component as the type of property to monitor. Easy enough, I configure an alert to alert off of the Statistic Data (Numeric) Now if both these alerts trigger at the same time I only get one alert.
The only fixes I can think of are to separate each process into its own component, the downside is I am then opening several ssh sessions instead of just one
Or, I configure a separate rule for each Process which will mean creating 50 rules that then have to be managed individually. Are there any other options?
#!/usr/bin/ksh #check status of processes # # LIST contains the list of processes to check add more as needed # NMBR keeps count of how many processes are checked and is reported in the outp ut message # LIST="root;cron" NMBR=1 IFS=";" for PROCESS in ${LIST}; do if ps -ef|grep -v $0|grep -v grep|grep "${PROCESS}" > /dev/null; then NUM=`ps -ef|grep -v $0|grep -v grep|grep "${PROCESS}"|wc -l` NUM=$( echo "$NUM" | tr -d ' ' ) echo "Statistic.Process${NMBR}: ${NUM}" echo "Message.Process${NMBR}: "${PROCESS}"" #echo "Process "${PROCESS}" is running $NUM instance(s)" else NUM=0 echo "Statistic.Process${NMBR}: ${NUM}" echo "Message.Process${NMBR}: "${PROCESS}"" #echo "Process "${PROCESS}" is running $NUM instance(s)" echo "Message.Process${NMBR}: "${PROCESS}"" #echo "Process "${PROCESS}" is running $NUM instance(s)" fi ((NMBR+=1)) done |