The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SSL monitor cPanel DNS only server with Nagios

Discussion in 'General Discussion' started by Erik Ellsinger, Oct 26, 2015.

  1. Erik Ellsinger

    Erik Ellsinger Active Member

    Joined:
    Sep 25, 2015
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Sweden
    cPanel Access Level:
    Root Administrator
    I have installed a certificate for the cPanel DNS Only webinterface (WHM). And I have a Nagios server which I want to use to monitor the certificate so I get alerted when it's about to expire.

    That is no problem for a normal cPanel server but it doesn't seem to work on a DNS only server. This is my command:

    Code:
    define command {
      command_name  check_ssl_expiry
      command_line  $USER1$/check_http -H $ARG1$ -S --sni -f follow -C 14,7 -p $ARG2$
    }
    
    And this is my service definition:
    
    define service{
      use  generic-service-daily
      host_name  ns1.example.net
      service_description  Certificate ns1.example.net
      check_command  check_ssl_expiry!ns1.example.net!443
    }
    
    
    The server doesn't seem to respond at port 443, anyone got a suggestion on how to solve this?
     
    #1 Erik Ellsinger, Oct 26, 2015
    Last edited by a moderator: Oct 27, 2015
  2. anton_latvia

    anton_latvia Well-Known Member
    PartnerNOC

    Joined:
    May 11, 2004
    Messages:
    348
    Likes Received:
    3
    Trophy Points:
    18
    Location:
    Latvia
    cPanel Access Level:
    Root Administrator
    WHM does not listen on port 443. What if you try port 2087 instead?
     
  3. Erik Ellsinger

    Erik Ellsinger Active Member

    Joined:
    Sep 25, 2015
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Sweden
    cPanel Access Level:
    Root Administrator
    Tried port 2087 instead now but that doesn't work either. All I get is a socket timeout message in Nagios.
     
  4. anton_latvia

    anton_latvia Well-Known Member
    PartnerNOC

    Joined:
    May 11, 2004
    Messages:
    348
    Likes Received:
    3
    Trophy Points:
    18
    Location:
    Latvia
    cPanel Access Level:
    Root Administrator
    Did you try running it from nagios server's console? I might still have old plugins, so some parameters wont work, but this line works fine

    /usr/local/nagios/libexec/check_http -H web1.cpanel.guru -S -f follow -C 7 -p 2087
     
  5. anton_latvia

    anton_latvia Well-Known Member
    PartnerNOC

    Joined:
    May 11, 2004
    Messages:
    348
    Likes Received:
    3
    Trophy Points:
    18
    Location:
    Latvia
    cPanel Access Level:
    Root Administrator
    May firewall on dns-admin does not let you connect?
     
  6. Erik Ellsinger

    Erik Ellsinger Active Member

    Joined:
    Sep 25, 2015
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Sweden
    cPanel Access Level:
    Root Administrator
    Oh yeah, stupid me. Forgot to open port 2087 on my Nagios server, everything works now!
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,736
    Likes Received:
    661
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page