Ad Widget

Collapse

Zabbix 1.4.4 NTP problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pasqu
    Junior Member
    • Jun 2007
    • 29

    #1

    Zabbix 1.4.4 NTP problem

    Hi all, I'm trying to test from zabbix agent one of my NTP in the network.
    My key is net.tcp.service[ntp,192.168.0.10,] but zabbix say "not supported".

    In the log I see:


    27752:20080221:121935 Requested [net.tcp.service[ntp,192.168.0.10,]]
    27752:20080221:121935 Sending back [ZBX_NOTSUPPORTED]


    Anyone have some ideas?

    Thanks Enrico.
  • xs-
    Senior Member
    Zabbix Certified Specialist
    • Dec 2007
    • 393

    #2
    I dont think net.tcp.service recognises NTP as a servicename (afaik the services list is hardcoded in the agent).
    You should try using the portnumber.

    Oh yeah, NTP usualy uses UDP
    Also, i'd make a UserParameter in the agent config to actually check the ntp service (using ntpdate or something) so you can verify the response intead of a port open.

    Comment

    • Tenzer
      Senior Member
      • Nov 2007
      • 316

      #3
      NTP is only using the UDP protocol, not TCP. You will have to use an external script in order to check if a NTP server is responding. I am using the following PHP script in order to do this:
      PHP Code:
      #!/usr/bin/php
      <?
          // Check for required parameters
          if($_SERVER[argv][1])
          {
                  $ntp_server = $_SERVER[argv][1];
          } else {
                  echo "You need to supply a NTP server to check. Quitting.\n";
                  exit;
          }

          // Do query
          $query = exec("ntpdate -q -t 0.1 ".$ntp_server, $output, $return);

          if($return == 0)
          {
                  echo "1\n";
          } else {
                  echo "0\n";
          }
      ?>
      The benefit of using a script like this, is that it also checks the stratum of the server. If it for instance is 16, then the script will fail.

      Comment

      • nwisrlit
        Junior Member
        • Dec 2009
        • 1

        #4
        Simpler test for NTP

        in /etc/zabbix/zabbix_agentd.conf, add the following line:

        Code:
        UserParameter=ntp.up,if ntpdate -q -t 0.1 localhost > /dev/null 2>&1 ; then echo 1 ; else echo 0 ; fi
        Then add an "item" referring to "ntp.up" - it returns 1 if NTP is handing out times, 0 if it's not (stratum too high, daemon down, whatever)

        Enjoy!

        Comment

        Working...