Closed ludmilmm closed 9 years ago
For the current version it is correct behavior. This is what you can do for easy switching before Developers are fixing it. Prepare command "command_service_ncpa", which will equal
$USER1$/check_ncpa.py -H $HOSTADDRESS$ -P 5693 -t token -M 'service/$ARG1$/running'
So, now you can use it in service check and provide in ARG1 the service name that you wan to check.
If in future you want to change the way how to check service - you need to change only command and remember that service name is in ARG1.
-M 'service/servicname/running' already works with current check_ncpa.
If i understand what you are saying is that the current check_ncpa is not capabile of querying the api using the same syntax used locally on the agent web interface?
Yes, it already works with current.
But the way that I have explained you is the way to avoid any changes, or to quick change, if developers make decision to change the behavior of agent or check_ncpa.py plugin.
Sorry I should have said I understood what you were saying. This is more for end-users in operations who have a specific need to see the status of several services at once on a particular host. This would involve having a seperate check for each one.
But your information does prove usefull in other areas :).
If your checks is under windows OS based server - I can share with you my VBS script which does checks against all services that are in "Automatic" start mode.
Yes please share. Assuming this would be a NCPA plugin?
does not matter with which agent you are using it. You can use it with NSClient++ or NCPA or what ever is exist :)
https://drive.google.com/folderview?id=0B1xMI2jsW6Y6bTVsN0tEbGtkbEE&usp=sharing
Ludmil,
I updated the check_ncpa.py plugins to now have a -q options, that should accept the query args you were attempting to use before. So all the arguments would just be the args like
check_ncpa.py args args -q 'service=Bingo,service=Bongo'```
that it will pass those as query args to the URL.
Thanks, Nick! Time for testing... :)
I am using NCPA 1.7.2 installed on Windows 7 64-bit. I can view the status of a service in the API, for example:
https://192.168.x.x:5693/api/services?service=Dhcp
but I am not able to use the same syntax from the CLI:
/usr/local/nagios/libexec/check_ncpa.py -H 192.168.x.x -t 'token' -P 5693 -M 'services?service=Dhcp' -v
or/usr/local/nagios/libexec/check_ncpa.py -H 192.168.x.x -t 'token' -P 5693 -M 'services\?service=Dhcp' -v
give me the following error:
However, if I use the old (deprecated) way of checking, I can get the correct output: