Monitoring a service or process
Monitoring a service or process
I have been asked to monitor a specific third party service
I can monitor the up/down state of the service but im looking for a way to get alerted based on memory/cpu usage.
Im not really sure where to go from here. I guess I should be using wmiPlus? If someone knows of a previously published writeup on the topic I can research it that way.
But my searching hasn't turned up anything useful.
I can monitor the up/down state of the service but im looking for a way to get alerted based on memory/cpu usage.
Im not really sure where to go from here. I guess I should be using wmiPlus? If someone knows of a previously published writeup on the topic I can research it that way.
But my searching hasn't turned up anything useful.
Re: Monitoring a service or process
What platform is the service running on? It sounds like Windows based off of your WMI suggestion.
Are you looking to find out how much RAM and CPU that specific service is using?
Are you looking to find out how much RAM and CPU that specific service is using?
Former Nagios employee
Re: Monitoring a service or process
Nagios is running on Linux. But my enterprise is all Windows.
I used the preconfigure VM and purchased licensing.
Yes, I would like to be able to monitor CPU/RAM usage for that specific service and get alerted if it goes over a certain threshold.
I used the preconfigure VM and purchased licensing.
Yes, I would like to be able to monitor CPU/RAM usage for that specific service and get alerted if it goes over a certain threshold.
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Monitoring a service or process
A service will be a running executable. Here are some examples:
For a full list of options including how to define warning and critical:
Code: Select all
/usr/local/nagios/libexec/check_wmi_plus.pl -H 10.25.14.2 -u Administrator -p password -m checkproc -s cpu -a spoolsv%
OK (Sample Period 75 sec) - Found 1 Instance(s) of "spoolsv%" running. CPU_spoolsv(PID=504)=0.0% |'Process Count'=1; 'Avg Utilisation CPU_spoolsv'=0.0%; Code: Select all
/usr/local/nagios/libexec/check_wmi_plus.pl -H 10.25.14.2 -u Administrator -p password -m checkproc -s memory -a spoolsv%
OK - Found 1 Instance(s) of "spoolsv%" running. Total Private Memory=5.617MB, Total Working Set=9.984MB, Total Virtual Memory=0.075GB\nProcesses Found are spoolsv (PID=504|'Process Count'=1; 'Total Private Memory'=5890048Bytes; 'Total Working Set'=10469376Bytes; 'Total Virtual Memory'=80183296Bytes; Code: Select all
/usr/local/nagios/libexec/check_wmi_plus.pl --itexthelpAs of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Monitoring a service or process
I'm pretty new to Nagios, and Linux environments. So this has been a double whammy for me.
What do I do with those commands?
Here?

I'll gladly read some documentation on how to do these basics I just had a hard time finding it.
What do I do with those commands?
Here?

I'll gladly read some documentation on how to do these basics I just had a hard time finding it.
Re: Monitoring a service or process
What you showed is exactly where you need to add to the definition to get it to run what you want. Whatever you change there will only affect the service you're changing it on. Basically take the ending command (the -s and -a) and put it in for whatever windows process you're trying to monitor. You can check to see if your command is running fine by doing the "Test Check Command" and it should show you the command it is running so you can see if everything is getting added to it properly.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Monitoring a service or process
I'm just not getting it. Would you be so kind as to post an example screenshot?
Ive tried every permutation of these commands in the screenshot above and it doesn't seem to be acknowledging them.
Ive tried every permutation of these commands in the screenshot above and it doesn't seem to be acknowledging them.
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Monitoring a service or process
These two screenshots should clearly explain it.
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Monitoring a service or process
That did it! The memory checker is working like a champ. But im having an issue with the CPU check.
its configured the same so not sure why this is happening.

Error: UNKNOWN - Permission denied when trying to store the state data. Sometimes this happens if you have been testing the plugin from the command line as a different user to the Nagio process user. You will need to change the permissions on the file or remove
its configured the same so not sure why this is happening.

Error: UNKNOWN - Permission denied when trying to store the state data. Sometimes this happens if you have been testing the plugin from the command line as a different user to the Nagio process user. You will need to change the permissions on the file or remove
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Monitoring a service or process
There are some files in /tmp that get created (probably when tested as root) and the nagios process cannot update them.
cwpss_checkcpu_1025142___.state
cwpss_checkproccpu_1025142_spoolsv__.state
Execute this command at the CLI and it should fix the problem:
cwpss_checkcpu_1025142___.state
cwpss_checkproccpu_1025142_spoolsv__.state
Execute this command at the CLI and it should fix the problem:
Code: Select all
chmod a+rw /tmp/cwp*As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.