Monitoring PS Command Result

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
abdelhafeth.mzahem
Posts: 38
Joined: Thu Jun 04, 2015 1:22 am

Monitoring PS Command Result

Post by abdelhafeth.mzahem »

Dears


We have a linux server, and Server admin request that the result of the ps command must be as shown below:

ps -ef |grep HLR_SH | grep -v "grep HLR_SH" | grep -v "HLR_SH.ini"

the expected result is :

eppix 30392 1 0 11:39 ? 00:00:00 /MaP/bin/ericsson_cai_telnet_sh /MaP/config/HLR_SH1.ini
eppix 30393 1 0 11:39 ? 00:00:00 /MaP/bin/ericsson_cai_telnet_sh /MaP/config/HLR_SH2.ini
eppix 30394 1 0 11:39 ? 00:00:00 /MaP/bin/ericsson_cai_telnet_sh /MaP/config/HLR_SH3.ini
eppix 30395 1 0 11:39 ? 00:00:00 /MaP/bin/ericsson_cai_telnet_sh /MaP/config/HLR_SH4.ini
eppix 30396 1 0 11:39 ? 00:00:00 /MaP/bin/ericsson_cai_telnet_sh /MaP/config/HLR_SH5.ini

If one of the above processes is missing we need to receive a notification (MaP is missing )

what is the best practice to achieve it ?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Monitoring PS Command Result

Post by tmcdonald »

I would write a plugin that grabs the output and does a line count on it. Plugins follow a pretty simple set of requirements:

https://nagios-plugins.org/doc/guidelines.html

They can be written in just about any language. Once you have that built, look into something like NRPE to run it on a remote machine:

https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Former Nagios employee
abdelhafeth.mzahem
Posts: 38
Joined: Thu Jun 04, 2015 1:22 am

Re: Monitoring PS Command Result

Post by abdelhafeth.mzahem »

thank you for reply,


IF I want to monitor it as process what process name I must use ? as I use all possible but not work


eppix 30392 1 0 11:39 ? 00:00:00 /MaP/bin/ericsson_cai_telnet_sh /MaP/config/HLR_SH1.ini

what condition must be in process to be monitored by check_snmp_process ?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Monitoring PS Command Result

Post by ssax »

You should be able to do it with this command:

Code: Select all

./check_snmp_process.pl -H 192.168.4.124 -C public -n "/MaP/bin/ericsson_cai_telnet_sh /MaP/config/HLR_SH[0-9].ini" -w 4 -c 4 -A "/MaP/config/HLR_SH[0-9].ini"
abdelhafeth.mzahem
Posts: 38
Joined: Thu Jun 04, 2015 1:22 am

Re: Monitoring PS Command Result

Post by abdelhafeth.mzahem »

Hi,

Thank you for reply; that's exactly what we want. How to monitor it using check_snmp_process commands .

I tried the command but not work.


[root@nms libexec]# ./check_snmp_process.pl -H 10.100.1.94 -C jawwal-snmp -n "/MaP/bin/ericsson_cai_telnet_sh /MaP/config/HLR_SH[0-9].ini" -w 0 -c 0 -A "/MaP/config/HLR_SH[0-9].ini"
Unknown option: A
No process matching /MaP/bin/ericsson_cai_telnet_sh /MaP/config/HLR_SH[0-9].ini found : CRITICAL
[root@nms libexec]# ./check_snmp_process.pl -H 10.100.1.94 -C jawwal-snmp -n "/MaP/bin/ericsson_cai_telnet_sh /MaP/config/HLR_SH1.ini" -w 0 -c 0 -A "/MaP/config/HLR_SH1.ini"
Unknown option: A
No process matching /MaP/bin/ericsson_cai_telnet_sh /MaP/config/HLR_SH1.ini found : CRITICAL
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Monitoring PS Command Result

Post by ssax »

What version of check_snmp_process.pl are you using?

Code: Select all

./check_snmp_process.pl -V
Also, you might need to put quotes around your snmp community because of the - in it.
abdelhafeth.mzahem
Posts: 38
Joined: Thu Jun 04, 2015 1:22 am

Re: Monitoring PS Command Result

Post by abdelhafeth.mzahem »

check_snmp_process version : 1.4
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Monitoring PS Command Result

Post by Box293 »

Please check your support ticket, I have given you an answer this way.

FYI the -A argument is not in the v1.4 of the plugin, please download the latest version:

http://nagios.proy.org/snmp_process.html
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked