Monitoring a windows service with Nagios
Monitoring a windows service with Nagios
Hi all,
I have successfully setup my nagios monitoring server and its works very good when i am monitoring disk space on several of our servers. However, recently, i was asked to monitor a specific service on one of our machines, and i followed the documentation. Strange thing is even with the correct syntax , i still get a message saying "C not found". I am not using the usediskspace from check_nt, so i dont know what else i should check.
Here is what i have in my windows.cfg file
define service{
host_name hostname.aimfire.net
service_description service ( values i changed for obvious reasons)
check_command check_nt!SERVICESTATE!-d SHOWALL -l service
max_check_attempts 1
check_period 24x7
notification_interval 60
notification_period 24x7
contact_groups admins
}
Any help is gladly appreciated.
Thanks
I have successfully setup my nagios monitoring server and its works very good when i am monitoring disk space on several of our servers. However, recently, i was asked to monitor a specific service on one of our machines, and i followed the documentation. Strange thing is even with the correct syntax , i still get a message saying "C not found". I am not using the usediskspace from check_nt, so i dont know what else i should check.
Here is what i have in my windows.cfg file
define service{
host_name hostname.aimfire.net
service_description service ( values i changed for obvious reasons)
check_command check_nt!SERVICESTATE!-d SHOWALL -l service
max_check_attempts 1
check_period 24x7
notification_interval 60
notification_period 24x7
contact_groups admins
}
Any help is gladly appreciated.
Thanks
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Monitoring a windows service with Nagios
Before checking the results in the Nagios web UI, have you tried running the command from your Nagios server's CLI? Can you share how you are running the command manually?
Re: Monitoring a windows service with Nagios
Hi slansing
i didnt think of running the CLI first, i did and here is the result
./check_nt -H 192.168.1.22 -v SERVICESTATE -d SHOWALL -l service
Connection refused
could not fetch information from server
Weird, i am looking on the server itself, nsclient.ini seems to have the right config....
i didnt think of running the CLI first, i did and here is the result
./check_nt -H 192.168.1.22 -v SERVICESTATE -d SHOWALL -l service
Connection refused
could not fetch information from server
Weird, i am looking on the server itself, nsclient.ini seems to have the right config....
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Monitoring a windows service with Nagios
Verify the following:
- Verify that your Nagios server's IP is correctly defined in your NSC.ini file
- Ensure nsclientlistener.dll is not commented out in the modules section
- Ensure netstat -an shows windows is listening on port 5666, and 1248
- Verify that your Nagios server's IP is correctly defined in your NSC.ini file
- Ensure nsclientlistener.dll is not commented out in the modules section
- Ensure netstat -an shows windows is listening on port 5666, and 1248
Re: Monitoring a windows service with Nagios
Looks like 1248 is already in use as my server has a connection established on that port.
However 5666 is listening, and i see 12489 as well, im assuming this is the nagios service...?
Is there a way to change the nsclient to listen on a different port?
thanks for your help
However 5666 is listening, and i see 12489 as well, im assuming this is the nagios service...?
Is there a way to change the nsclient to listen on a different port?
thanks for your help
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Monitoring a windows service with Nagios
Under the NSC.ini file look for a line titled similar to this:
Here you can change the port, though the currently in use one may be being used by NSClient, try stopping the service then checking again.
Code: Select all
;# NSCLIENT PORT NUMBER
; This is the port the NSClientListener.dll will listen to.Re: Monitoring a windows service with Nagios
In the nsclient.ini file, i see no such line.
Its not in the modules section. im using NSCP-0.4.1.61
Maybe its my version thats outdated?
Its not in the modules section. im using NSCP-0.4.1.61
Maybe its my version thats outdated?
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Monitoring a windows service with Nagios
No, you have one of the newest versions which can cause issues. 0.3.9 is the recommended release to use, however you should be able to compile for the additional options, if you look at the top of your NSC.ini file you should see a command to run from the CLI to enable these options. The command may be different than the one I have so if it is not there let me know.
Re: Monitoring a windows service with Nagios
I have downloaded and installd the 0.3.9 release,
i do find the information you mentionned, so i changed the port number, just not sure if i uncommented right
NSclient PORt number
This is the port the nsclientlistener.dll will listen to.
port=12489
So i just took out the ";" that were in front of that line?
i do find the information you mentionned, so i changed the port number, just not sure if i uncommented right
NSclient PORt number
This is the port the nsclientlistener.dll will listen to.
port=12489
So i just took out the ";" that were in front of that line?
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Monitoring a windows service with Nagios
Yes the following line must be un-commneted, leave the two above it describing it commented:
Most admins have changed the port from 12489 to 5666 because it is easier to manage and is close to 5667 which is what NSCA uses, just make sure once you place 5666 in the configuration file that you unblock it from your Windows firewall on both incoming and outgoing, and the same for your nagios server.
Code: Select all
port=12489