Hello Guest

Author Topic: NTP Plugin  (Read 2780 times)

0 Members and 1 Guest are viewing this topic.

Offline AusAl

  • Jr. Member
  • **
  • Posts: 14
  • Karma: 0
    • View Profile
NTP Plugin
« on: February 21, 2016, 06:58:03 PM »
Hi, Would someone be able to help me out with a screen shot example of a NTP Plugin that's working? I'd like to monitor our NTP server and setup some alerts when it looses contacts with satalites. I'm using Pandora FMS Open Source 6.0. I'm a fairly new user of Pandora (6 months) but should be able to follow some more detailed instructions.

Trying to use this plugin with no success:

Any help or tips appreciated.

Thanks, Al.

Offline antonio.s

  • Administrator
  • Smart member
  • *****
  • Posts: 288
  • Karma: 2
    • View Profile
Re: NTP Plugin
« Reply #1 on: March 17, 2016, 03:57:13 AM »
Hello AusAl,

The open NTP plugin is quite simple and requires no extra configuration, just empty execution. It gets env variables, like this:

# Info about ntp actual sync source - all retrieved with one query, later it's going to be appropiately parsed
NTP_INFO=`ntpq -p | grep "*"`

# Hostname of syncing source
NTP_HOST=`echo "$NTP_INFO" | awk '{print $2}'`
# Stratum of syncing source
NTP_STRATUM=`echo "$NTP_INFO" | awk '{print $3}'`
# Roundtrip  of syncing source
NTP_ROUNDTRIP=`echo "$NTP_INFO" | awk '{print $8}'`
# Offset of syncing source
NTP_OFFSET=`echo "$NTP_INFO" | awk '{print $9}'`
# Jitter of syncing source
NTP_JITTER=`echo "$NTP_INFO" | awk '{print $10}'`

So if those variables are not set, it won't display info.
You can edit easily this plugin to use the information obtained by the command "ntpq -p" instead. Take a look at the plugin's code.

Kind regards,