Page 1 of 1

Process monitoring

Posted: Tue Apr 21, 2020 9:56 am
by RIDS_I2MP
Hi Team,

We wanted to monitor a process (Snare service) which runs on windows servers.
We wanted Nagios to send alert if the process uses 15% CPU.

I have configured the same in Nagios using NCPA and it seems to be working fine. Not sure why, today the process was using more hat 30% CPU for almost an hour but Nagios did not generate any alert.

NCPA uses 5693 port and it is open already on the server. I am attaching here the screenshot of task manager where you would be able to see the Snare process using more that 30% CPU. Also, I am attaching the configuration screenshot from Nagios GUI.

Nagios shows OK state for the service, which means it is monitoring the service properly. I am not sure exactly what happened because of which it did not generate alert.

Thanks in advance for your help!!!

Re: Process monitoring

Posted: Tue Apr 21, 2020 4:07 pm
by cdienger
Please provide a screenshot of the dashboard so we can see the hostname and service name. Please also PM me a profile. A profile can be generated under Admin > System Config > System Profile > Download Profile, or from the command line with:

Code: Select all

/usr/local/nagiosxi/scripts/components/getprofile.sh 58261
The profile is then saved to:

/usr/local/nagiosxi/var/components/profile.zip

Re: Process monitoring

Posted: Wed Apr 22, 2020 10:17 am
by RIDS_I2MP
Hi,
PFA he required information.

Hostname: EU1AWBW030
IP: 10.148.58.244

Re: Process monitoring

Posted: Wed Apr 22, 2020 3:15 pm
by cdienger
To trigger an alert if a process is using over a certain amount of CPU, you would want to create a check like this:

Code: Select all

./check_ncpa.py -H 10.148.58.244 -t 'nag1osadm1n' -M 'processes' -w 1 -c 1 -q 'name=SNARE Service,cpu_percent=15'
The above will trigger a CRITICAL if the CPU goes over 15%.

Re: Process monitoring

Posted: Thu Apr 23, 2020 7:43 am
by RIDS_I2MP
Hello,

Thanks for your help!!

I have made the changes as per your suggestion.
The CPU usage goes high rarely on that server. So I am unable to perform the testing.
Is there any way to check if the command is working fine?
I tried checking in graphs as well if it has used 2-3 percent of CPU, but could not find anything there.

Re: Process monitoring

Posted: Thu Apr 23, 2020 2:46 pm
by cdienger
Running it from the command line to see the result would be a good test:

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H 10.148.58.244 -t 'nag1osadm1n' -M 'processes' -w 1 -c 1 -q 'name=SNARE Service,cpu_percent=1'
And in case it needs clarifying, this check doesn't return the % used by the process so the graphs in XI wouldn't be the place to check for the usage. This check will return the number of processes that meet the filter criteria.

Re: Process monitoring

Posted: Mon Apr 27, 2020 1:41 am
by RIDS_I2MP
Thanks for your help!!

Its working fine now.

Re: Process monitoring

Posted: Mon Apr 27, 2020 11:35 am
by cdienger
Glad to hear!