How to Deal with Special Symbol in Nagios Service Parameter
Posted: Tue Sep 03, 2013 3:56 am
Hi ,
In order to monitor windows service status, recently I added some monitors in my nagios application.
First I created a check command named check_win_service, the command use the check_nrpe script
next I defined a service on every windows host, in these services I replace the variable $ARG1$ with the windows services I want to monitor, thus I didn't need to create multiple nagios services for every windows service, below is the example service list I used to replace $ARG1$:
If there is no symbol '$' in the service name, the check result would be successful
If there is '$' in service name, such as a MS SQL service with an instance name, the check result would be failed
I guess this may be caused by variable replacement, but I am not a programmer, I don't know how to read the code to find the issue point.
Please give me some ideas or suggestions, thanks in advance for your help.
Regards,
Jun
In order to monitor windows service status, recently I added some monitors in my nagios application.
First I created a check command named check_win_service, the command use the check_nrpe script
Code: Select all
$USER1$/check_nrpe -H $HOSTADDRESS$ -c CheckServiceState -a ShowAll $ARG1$Code: Select all
MSSQLServerOLAPService SQLSERVERAGENT MSSQL\\\$SQLEXPRESS MSSQLSERVERCode: Select all
Status Information: OK: MSSQLServerOLAPService: started, SQLSERVERAGENT: started, MSSQLSERVER: startedCode: Select all
Status Information: CRITICAL: MSSQLServerOLAPService: started, SQLSERVERAGENT: started, MSSQL$SQLEXPRESS: started, MSSQLSERVER$: not found (critical)Please give me some ideas or suggestions, thanks in advance for your help.
Regards,
Jun