Ad Widget

Collapse

Is it possible to have Zabbix monitor ntp?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jackiebaron
    Junior Member
    • Oct 2014
    • 17

    #1

    Is it possible to have Zabbix monitor ntp?

    OK, I'm quite the newbie and this question is probably a little vague or has probably been answered but I do need help.

    I have some ntp servers and each day I have to check the health of the ntp on them. Not that the ntp daemon is running..as simply ps -ef could do that. But is there actually any kind of Zabbix module that checks the health of the ntp service?
    When I execute ntpq -p I should get something like the following:

    $ ntpq -p
    remote refid st t when poll reach delay offset jitter
    ================================================== ============================
    192.168.140.21 .MRS. 1 u 1 16 377 0.970 0.057 0.275
    oPPS(0) .PPS. 0 l 3 16 377 0.000 -0.023 0.000
    +SHM(0) .shm0. 0 l 9 16 377 0.000 -0.015 0.000



    That tells me that it's ok when I have those 3 entries.

    I'm still just getting up to speed on Zabbix so please don't bombard me with serious stuff that only a Zabbix master would understand.

    Thanks
  • BDiE8VNy
    Senior Member
    • Apr 2010
    • 680

    #2
    You can extend the Zabbix agent (as well as proxy and server) by custom functions via User parameters or loadable modules.
    See User parameter one-liners to get some ideas regarding User parameters.

    Comment

    • harmonica
      Senior Member
      • Jan 2009
      • 251

      #3
      Originally posted by jackiebaron
      OK, I'm quite the newbie and this question is probably a little vague or has probably been answered but I do need help.

      I have some ntp servers and each day I have to check the health of the ntp on them. Not that the ntp daemon is running..as simply ps -ef could do that. But is there actually any kind of Zabbix module that checks the health of the ntp service?
      When I execute ntpq -p I should get something like the following:

      $ ntpq -p
      remote refid st t when poll reach delay offset jitter
      ================================================== ============================
      192.168.140.21 .MRS. 1 u 1 16 377 0.970 0.057 0.275
      oPPS(0) .PPS. 0 l 3 16 377 0.000 -0.023 0.000
      +SHM(0) .shm0. 0 l 9 16 377 0.000 -0.015 0.000



      That tells me that it's ok when I have those 3 entries.

      I'm still just getting up to speed on Zabbix so please don't bombard me with serious stuff that only a Zabbix master would understand.

      Thanks

      Hi,

      If you want to check if the service is runing use proc.num[ntpd]

      If you want to check the service state use ntpstat | echo $?
      0 ⇒ synchronised
      1 ⇒ not synchronised
      2 ⇒ indeterminant

      Comment

      • jackiebaron
        Junior Member
        • Oct 2014
        • 17

        #4
        You mean do a

        zabbix_get -s <ntp machine> -p10050 -k proc.num[ntpd] ??

        Comment

        • harmonica
          Senior Member
          • Jan 2009
          • 251

          #5
          Originally posted by jackiebaron
          You mean do a

          zabbix_get -s <ntp machine> -p10050 -k proc.num[ntpd] ??
          Hi.

          Create item proc.num[ntpd] in every NTP server.

          Comment

          • jackiebaron
            Junior Member
            • Oct 2014
            • 17

            #6
            Originally posted by harmonica
            Hi.

            Create item proc.num[ntpd] in every NTP server.
            OK harmonica, I really appreciate your help but like my original post stated I am a newbie so don't assume I even know what an "item" is.

            You mentioned if I want to check if ntp is running then I just execute this from the Zabbix server:

            zabbix_get -s <node> -p10050 -k proc.num[ntpd]

            and that will tell me how many ntpd processes are running. That's fine. I can do that on the node with a simple ps -ef |grep ntp as well. But this is manual.

            I need for the agent to monitor the ntp service by itself and have a message pop up on the Zabbix management server when the service is DOWN.

            How come when I kill http on the managed node I get a message on the Zabbix server saying "http is down", but when I kill ntp I get nothing?

            Comment

            • BDiE8VNy
              Senior Member
              • Apr 2010
              • 680

              #7
              Originally posted by jackiebaron
              [...] don't assume I even know what an "item" is.
              I strongly encourage to read the online documentation first. Without knowing the naming convention and understanding the underlying concepts, it's likely to become frustrated quickly.

              As a starting point you might take a look at these chapters (incl. sub chapters):


              Comment

              • cferraro
                Junior Member
                • Jun 2011
                • 16

                #8
                Originally posted by harmonica
                Hi,

                If you want to check if the service is runing use proc.num[ntpd]

                If you want to check the service state use ntpstat | echo $?
                0 ⇒ synchronised
                1 ⇒ not synchronised
                2 ⇒ indeterminant
                I replaced the pipe with a semicolon above. When using a pipe I always got an exit of 0 regardless of the service state. The semicolon strings the 2 commands for expected results.

                Comment

                Working...