Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Hello I am trying to find a template or config guide for how to monitor a windows service. Specifically the print spooler of server 2012 print server.I am using the ncpa-2.2.0. I am trying to add it to the ncpa.cfg file. I found this check but it does not work:
I obviously changed the required info like token and hostname to the correct thing.
I have tried to change the service= to these things:
'service=spoolsv.exe'
'service=spooler'
This is whats returned when I run the ./check_ncpa.py command:
UNKNOWN: Error occurred while running the plugin. Use the verbose flag for more details.
So then I run it with -vvv and this is the full out put of the command and what I get back:
[alan@Monitor libexec]$ ./check_ncpa.py -H printserver -t token -M 'services' -q 'service=C:spoolsv.exe' -vvv
Connecting to: https://printserver:5693/api/services/?token=token&check=1&service=C%3Aspoolsv.exe
An error occurred:<urlopen error [Errno -2] Name or service not known>
Thanks for the reply. So when I use what you suggested this does come back with - OK: Spooler is running. How would I be able to add this to the ncpa.cfg file for this print server? Right now for this server I am monitoring the CPU Load, the C:\ Drive space, and Memory Usage. I tried to add this to the file.
Error: Service check command 'check_ncpa.py -H 172.16.10.31 -t Str0ngT0k3n -M services -q service=Spooler,status=running' specified in service 'Print Spooler' for host 'Svr-Print01' not defined anywhere!
So I change the check_command check_ncpa.py to check_command check_ncpa!-t and it is not working.
One thing I am trying to find out is if that service stops can I have Nagios kick off a script that would essentially delete all the contents of the PRINTER folder and restart the spooler?
One thing I am trying to find out is if that service stops can I have Nagios kick off a script that would essentially delete all the contents of the PRINTER folder and restart the spooler?
Yes. You can setup Naigos to fire an event handler (script) whenever a state change occurs.
I hope this is the info you are wanting? Thanks for the Event Handlers I will read through it and see if I can get it to work. I have a side question if we ever move to Nagios I will all these setting that I am configuring move over as well or would I need to reconfigure everything?
I think that is it. I will look at the Event Handlers page and see if I can get it to work. If for some reason I cannot I will most likely open a new thread. Thanks for all your help with this. Have a great day.