NCPA check for Windows Service
NCPA check for Windows Service
Hi Team,
I have a service running in a windows box which contains "$" symbol in the sevcice name, i know i can monitor that service using NCPA command like below:
Running the following active check from the command line:
./check_ncpa.py -H <HOSTNAME> -t '<your token>' -M 'services' -q 'service=SQLAgent$SQL01'
Would result in the following output:
OK: SQLAgent$SQL01 is running
But when I configure that service check in nagios i'm getting different output in the dashboard, i know thats because of "$" sign present in the service name.
Below is the Output of Nagios check from UI:
Windows Service: SQLAgentSQL01 Critical 22m 22s 4/4 2017-12-05 15:16:23 CRITICAL: SQLAgent$SQL01 is running (should be running$)
Is there a way to overcome this situation as its showing CRITICAL alert when the service is still running.
Regards,
Madhukar.
I have a service running in a windows box which contains "$" symbol in the sevcice name, i know i can monitor that service using NCPA command like below:
Running the following active check from the command line:
./check_ncpa.py -H <HOSTNAME> -t '<your token>' -M 'services' -q 'service=SQLAgent$SQL01'
Would result in the following output:
OK: SQLAgent$SQL01 is running
But when I configure that service check in nagios i'm getting different output in the dashboard, i know thats because of "$" sign present in the service name.
Below is the Output of Nagios check from UI:
Windows Service: SQLAgentSQL01 Critical 22m 22s 4/4 2017-12-05 15:16:23 CRITICAL: SQLAgent$SQL01 is running (should be running$)
Is there a way to overcome this situation as its showing CRITICAL alert when the service is still running.
Regards,
Madhukar.
-
dwhitfield
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: NCPA check for Windows Service
To track this down, we'd need to know the version of check_ncpa.py and NCPA at the very least.
The "easiest" thing to do may be to put this in a macro: https://assets.nagios.com/downloads/nag ... ponent.pdf
My method for escaping is usually guess and check. There are only a few escape characters and quotation combinations, but depending on version #s, macros may be the only way to go.
Can you PM me your Profile? You can download it by going to Admin > System Config > System Profile and click the ***Download Profile*** button towards the top. If for whatever reason you *cannot* download the profile, please put the output of View System Info (5.3.4+, Show Profile if older) in the thread (that will at least get us some info). This will give us access to many of the logs we would otherwise ask for individually. If security is a concern, you can unzip the profile take out what you like, and then zip it up again. We may end up needing something you remove, but we can ask for that specifically.
You can also generate a profile manually using the script at /usr/local/nagiosxi/html/includes/components/profile/getprofile.sh
That should generate a profile in /usr/local/nagiosxi/var/components/ which you can get off the server with an application such as FileZilla.
After you PM the profile, please update this thread. Updating this thread is the only way for it to show back up on our dashboard.
If you get an error that PROFILE BUILD FAILED, please see https://support.nagios.com/kb/article.p ... ategory=44
The "easiest" thing to do may be to put this in a macro: https://assets.nagios.com/downloads/nag ... ponent.pdf
My method for escaping is usually guess and check. There are only a few escape characters and quotation combinations, but depending on version #s, macros may be the only way to go.
Can you PM me your Profile? You can download it by going to Admin > System Config > System Profile and click the ***Download Profile*** button towards the top. If for whatever reason you *cannot* download the profile, please put the output of View System Info (5.3.4+, Show Profile if older) in the thread (that will at least get us some info). This will give us access to many of the logs we would otherwise ask for individually. If security is a concern, you can unzip the profile take out what you like, and then zip it up again. We may end up needing something you remove, but we can ask for that specifically.
You can also generate a profile manually using the script at /usr/local/nagiosxi/html/includes/components/profile/getprofile.sh
That should generate a profile in /usr/local/nagiosxi/var/components/ which you can get off the server with an application such as FileZilla.
After you PM the profile, please update this thread. Updating this thread is the only way for it to show back up on our dashboard.
If you get an error that PROFILE BUILD FAILED, please see https://support.nagios.com/kb/article.p ... ategory=44
Re: NCPA check for Windows Service
Im using NCPA Version 2.0.5 and I tried User Macros and Free Variables on the Host both didn't work. They unable to substitute the variable in the service check command.
-
kyang
Re: NCPA check for Windows Service
Could you show us how you have this command defined in the Core Config Manager UI?
Have you tried any escaping characters for $?
https://support.nagios.com/kb/article.php?id=580
Have you tried any escaping characters for $?
https://support.nagios.com/kb/article.php?id=580
Re: NCPA check for Windows Service
Please refer the attachment. I tired escaping the $ but its complaining "UNKNOWN: No services selected with 'service' value given"
You do not have the required permissions to view the files attached to this post.
Re: NCPA check for Windows Service
Try removing the following in the $ARG4$ field (removing the "\" and adding one more "$"):
Save and apply configuration. Don't test it in the CCM (Run Check Command) as it will fail. Go to Home > Datails > Service Detail > <your service> and force an immediate check.
Did this help?
Update: I forgot to mention one more thing - I tested it with a check command defined as such:
Code: Select all
-M 'services' -q 'service=MSSQL$$SQL01,status=running'Did this help?
Update: I forgot to mention one more thing - I tested it with a check command defined as such:
Code: Select all
check_command check_xi_ncpa!-t 'mytoken' -P 5693 -M 'services' -q 'service=xxx$xxx,status=running'Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: NCPA check for Windows Service
Thanks that worked!!
-
kyang
Re: NCPA check for Windows Service
Sounds good! Glad that it worked for you!
Are we okay to close this thread? Or did you have any more questions?
Are we okay to close this thread? Or did you have any more questions?
Re: NCPA check for Windows Service
Yes we can close this thread
-
kyang
Re: NCPA check for Windows Service
Sounds good! I'll be closing this thread!
If you have any more questions, feel free to create another thread.
Thanks for using the Nagios Support Forum!
If you have any more questions, feel free to create another thread.
Thanks for using the Nagios Support Forum!