System Timezone Using check_xi_ncpa

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
esostarich
Posts: 6
Joined: Thu Aug 01, 2019 8:16 am

System Timezone Using check_xi_ncpa

Post by esostarich »

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.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: System Timezone Using check_xi_ncpa

Post by cdienger »

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

Post by esostarich »

Thank you for your response. Is there a preferred plugin that you could recommend for this use case, in the meantime?
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: System Timezone Using check_xi_ncpa

Post by cdienger »

The check_http plugin could be used. 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.*
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:

Code: Select all

/usr/local/nagios/libexec/check_http --help
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.* -v
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked