Page 1 of 1

Newbie help- check-ssl-certificate not evaluating $HOSTNAME$

Posted: Fri Nov 13, 2015 3:05 pm
by betsys
server Nagios XI 2012R2.9
OS Centos 2.6.32-504.12.2.el6.centos.plus.i686
(not 100% sure how it was built, before my time)
Plugin https://exchange.nagios.org/directory/P ... te/details

The plugin works at the command line as user nagios and apache (substituting example.com for my hostname)

[root@nagioslvs libexec]# sudo -u apache /usr/local/nagios/libexec/check_ssl_certificate -H myhost.example.com
m=Mar, d=30, h=23, m=59, s=59, y=2016, z=GMT
[root@nagioslvs libexec]# sudo -u nagios /usr/local/nagios/libexec/check_ssl_certificate -H myhost.example.com
m=Mar, d=30, h=23, m=59, s=59, y=2016, z=GMT

I defined it as a command in core config mgr:
$USER1$/check_ssl_certificate -H $HOSTNAME$
type check command, active

However when I create a service and check the command, I do not get prompted for a hostname and I get no output
if I change the command definitionto -H $HOSTADDRESS$ I do get prompted for a hostname when I check the command, but still no output
Testing check from command line...
COMMAND: /usr/local/nagios/libexec/check_ssl_certificate -H myhost.example.com
OUTPUT:

The host is defined with the FQDN in hostname, description,and display name, and the IP in Address. And the test works against this host in the command line

I feel like I'm missing something basic here. I've gone into the core dir and looked at the host and service file and they don't seem any different from the others
thanks Betsy

Re: Newbie help- check-ssl-certificate not evaluating $HOSTN

Posted: Mon Nov 16, 2015 1:05 am
by Box293
The "Test Check Command" button does not work with macros and can be frustrating.

So for all further testing of this service you need to:
  • Make the changes to the service
    Save the Service
    Apply Configuration
    Go back to the home screen and find the Service
    When viewing the Service Status Details page click the Schedule a forced immediate check link

Re: Newbie help- check-ssl-certificate not evaluating $HOSTN

Posted: Mon Nov 16, 2015 1:36 am
by betsys
Thank you, that explains a lot!!

I had installed the test and it was showing as CRITICAL (null) but now it is working. Now I have to figure out what I did right :o

Re: Newbie help- check-ssl-certificate not evaluating $HOSTN

Posted: Mon Nov 16, 2015 10:12 am
by hsmith
Is there anything else we can do to help you with this one?

Re: Newbie help- check-ssl-certificate not evaluating $HOSTN

Posted: Mon Nov 16, 2015 10:20 am
by betsys
I think I'm ok, thank you very much!
going to get the test onto my other servers this am
(trying to figure out why this went from not working to working, wondering if there was just a delay...)

Re: Newbie help- check-ssl-certificate not evaluating $HOSTN

Posted: Mon Nov 16, 2015 11:13 am
by tmcdonald
I'll be closing this thread now, but feel free to open another if you need anything in the future!