Hello,
I am using the check_xi_ncpa command with an argument of -M 'system/timezone', which is successfully listing the timezone. That said, I am unable to create a critical threshold that will error when the timezone is anything other than the desired timezone. For example, error when timezone does not equal UTC.
System Timezone Using check_xi_ncpa
Re: System Timezone Using check_xi_ncpa
It doesn't appear that string match is an option. I would suggest adding your name to the enhancement request at https://github.com/NagiosEnterprises/ncpa/issues/550.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
esostarich
- Posts: 6
- Joined: Thu Aug 01, 2019 8:16 am
Re: System Timezone Using check_xi_ncpa
Thank you for your response. Is there a preferred plugin that you could recommend for this use case, in the meantime?
Re: System Timezone Using check_xi_ncpa
The check_http plugin could be used. For example:
where <TOKEN> is the NCPA token assigned to the agent.
The above will connect to the NCPA service, pull that URL(passing it the token to authenticate), and then check the results to see if it contains UTC. A CRITICAL state will be triggered if it doesn't find a match. You can see all the options for check_http with:
and see verbose output with "-v". For example:
Code: Select all
/usr/local/nagios/libexec/check_http -H IP -p 5693 -S -u '/api/system/timezone/?token=<TOKEN>&check=1' -v -r .*UTC.*The above will connect to the NCPA service, pull that URL(passing it the token to authenticate), and then check the results to see if it contains UTC. A CRITICAL state will be triggered if it doesn't find a match. You can see all the options for check_http with:
Code: Select all
/usr/local/nagios/libexec/check_http --helpCode: Select all
/usr/local/nagios/libexec/check_http -H IP -p 5693 -S -u '/api/system/timezone/?token=<TOKEN>&check=1' -v -r .*UTC.* -vAs of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.