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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
betsys
Posts: 3
Joined: Tue Aug 19, 2014 2:04 pm

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

Post 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
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

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

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
betsys
Posts: 3
Joined: Tue Aug 19, 2014 2:04 pm

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

Post 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
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

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

Post by hsmith »

Is there anything else we can do to help you with this one?
Former Nagios Employee.
me.
betsys
Posts: 3
Joined: Tue Aug 19, 2014 2:04 pm

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

Post 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...)
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

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

Post by tmcdonald »

I'll be closing this thread now, but feel free to open another if you need anything in the future!
Former Nagios employee
Locked