NSClient++ Help (#1) - question about "check_all_services[SERVICE_AUTO_START]=started" [SOLVED] (#521) - Message List
Hi all,
I want to monitor all services that should be started at startup with this single line("check_all_services[SERVICE_AUTO_START]=started" directive in nsc.ini). Could someone advise me please how can I do this?
I figured out about alias in nsc.ini: ... alias_service=checkServiceState CheckAll? ... And tried to use following service definnition on the monitoring host side: define service{
use generic-service host_name test_winserver service_description All Services check_command check_nt!alias_service
} But it doesn't work for me. Excerpt from the nagios web interface as follows. test_winserver All Services UNKNOWN 03-01-2010 11:16:26 0d 0h 14m 1s 3/3 check_nt: Could not parse arguments
What should I put into my cfg file(s) on the monitoring host to make it work properly? Or problem is on the NSClient++ site?
And another question, what is the preferred way to monitor all services at once, "alias_service=checkServiceState CheckAll?" or one described here http://exchange.nagios.org/directory/Plugins/Operating-Systems/Windows/Check-Automatic-Services-for-Windows/details ?
Thanks in advance.
-
Message #1630
Hello,
I don't really understand what you want to do...
If you don't know how to use nrpe with NSCLient++ there is a guide for that here.
Michael Medin
mickem03/01/10 15:11:53 (2 years ago)-
Message #1650
Hi Michael,
thank you for your reply.
I don't really understand what you want to do...
I wanted to check all services that have Startup Type: "Automatic". And I didn't(and still don't) understand how to make appropriate sections in nsc.ini to work. Exactly, how can I use these settings?
[Check System] ... ;# CHECK ALL SERVICES ; Configure how to check services when a CheckAll is performed. ; ...=started means services in that class *has* to be running. ; ...=stopped means services in that class has to be stopped. ; ...=ignored means services in this class will be ignored. ;check_all_services[SERVICE_BOOT_START]=ignored ;check_all_services[SERVICE_SYSTEM_START]=ignored ;check_all_services[SERVICE_AUTO_START]=started ;check_all_services[SERVICE_DEMAND_START]=ignored ;check_all_services[SERVICE_DISABLED]=stopped
If I'll uncomment following line: "check_all_services[SERVICE_AUTO_START]=started" what should I put in service definition on the monitoring host side?
Actually I solved my problem, but I'm still curious how to use: "check_all_services[SERVICE_AUTO_START]=started" on the practice.
Here is my solution(if someone intersted in) On the Nagios Server:
define service{ use generic-service host_name test_winserver service_description All Services check_command check_nt!check_all_services_wsf }To check it:
/usr/lib/nagios/plugins/check_nrpe -H 192.168.10.28 -c check_all_services_wsf SERVICES CRITICAL: 1 Automatic Service not running - Print Spooler (I stopped it intentionnaly to check if this works)
On the windows server side: in the nsc.ini:
[NRPE] port=5666 [Check System] [External Scripts] check_all_services_wsf=c:\windows\system32\cscript.exe //NoLogo C:\NSClient++\scripts\check_all_services.wsf
That script(check_all_services.wsf) I downloaded from here http://exchange.nagios.org/directory/Plugins/Operating-Systems/Windows/Check-Automatic-Services-for-Windows/details
I just tried it and it seems to be work. If all goes well it will allow not to think about what service should we check. Just one line that solves all problems ;)
ddjjzz03/04/10 18:57:13 (2 years ago)-
Message #1651
I should correct myself.(It seems this forum engine doesn't allow to edit posts) In service definition there should be:
define service{ use generic-service host_name test_winserver service_description All Services check_command check_nrpe!check_all_services_wsf }ddjjzz03/04/10 19:13:41 (2 years ago) -
Message #1654
Since you are using a script to check service those option do no apply. Those options are for the internal CheckService? command.
Michael Medin
mickem03/05/10 08:12:20 (2 years ago)-
Message #1657
Those options are for the internal CheckService?? command.
Thanks a lot. Now it's clear... I will use embedded checks instead of that script of course. P.S. It would be nice to see it in Nagios's "default" documentation. ( http://nagios.sourceforge.net/docs/3_0/monitoring-windows.html) because I spent a lot of time trying to understand how to make it work for me.. I guess everyone wants to monitor all services together with ease. Thank you for help.
ddjjzz03/05/10 15:23:36 (2 years ago)
-
-
-
Message #1631
How would one know which services should be started at startup ?
I think you should start by examining your msconfig...all services that should start at startup are listed there...
DO NOT RELY ON START TYPE = AUTOMATIC... That only means that the service is started when needed.
mike2k03/01/10 22:57:37 (2 years ago)-
Message #1652
Hi mike2k.
I think I could apply exclusion for such situations(if service starts on system startup and exits after some time, if you mean it).
Exclusions can be applied in this fashion: cscript NOLOGO check_all_services.wsf /server:dc1 /exclude:Performance Logs and Alerts (according to the documentation: http://exchange.nagios.org/directory/Plugins/Operating-Systems/Windows/Check-Automatic-Services-for-Windows/details)
I think it's much faster than to specialize every service manually.
ddjjzz03/04/10 19:29:21 (2 years ago)
-
-







