Hi Michael,

they are unix systems (Mac OS 10.7) but they're not running net-snmp.  they're 
built as dedicated NTP stratum 2 servers.  Writing a script to parse ntpq -p 
output was our guess on next options.  the exiting ntp probe does a fine job of 
telling us that they are serving time, and it even reports their current 
stratum level. we just need to alert if the stratum drops below 2.  we'd need 
something like "ntpdc -c sysinfo" instead of "ntpq -c as localhost" to get the 
stratum info, but since we're not running an snmp daemon we'll have to build a 
custom probe to check the status as well.  We can do all this, we've done it 
before, I just didn't want to start from scratch if we didn't have to.

thanks for the ideas, and your example script could work for what we want with 
a few small adjustments, so that's quite handy as well.


oh, and if my original post shows up a second time, apologies. I got it this 
morning and opened my computer which promptly told me it hadn't sent, so I told 
it to try again, except of course it had sent. 


thanks for the ideas,
-debbie


On Mar 12, 2012, at 15:38, Michael Graziano wrote:

> Hi Debbie,
> 
> I've never used the built-in NTP probe, but if you're running unix systems 
> with net-snmp you can try the following:
> 
> 1) Add this script to the net-snmp "exec" list of external programs
> 
> ----- BEGIN -----
> #!/bin/sh
> #
> # Quick Script to check NTP daemon status.
> # Reports "NTP: OK"/RC:0 if I have a sys.peer server
> # Or "NTP: No Peer"/RC:1 otherwise.
> #
> 
> ntpq -c as localhost | grep 'sys\.peer' > /dev/null 2>&1
> 
> if [ $? -eq 0 ]; then
>       echo "NTP OK"
>       exit 0;
> else
>       echo "NTP: No Peer"
>       exit 1;
> fi
> 
> echo "Impossible Condition"
> exit 2
> -----  END  -----
> 
> 2) Use the generic SNMP Comparison or String Comparison probe to check/report 
> the status.
> 
> 
> 
> A local script/command-line probe running on the InterMapper server could do 
> the same basic checks for Windows hosts or stuff running an NTP daemon but 
> not able to support SNMP, and it could also be substantially more robust than 
> this implementation...
> 
> -MG
> 
> On Mar 12, 2012, at 2:48 PM, Debbie Fligor wrote:
> 
>> We recently had some of our stratum ntp servers replaced, and they didn't 
>> come up quite right, but were still answering ntp, so they went green on 
>> their map.  we're using the built in probe for ntp, which I noticed had the 
>> stratum value was underlined in the Status Window, and figured I might be 
>> able to set a compare for that.  I didn't see one in the Probe setting box, 
>> so I thought "no big deal, I'll just grab the probe, make a copy and have a 
>> custom ntp probe."  When I pulled the probe down, there no section that 
>> shows the heading "Network Time Protocol Status" that shows up in the status 
>> window for me to work with, and no variable retrieving the stratum 
>> information.
>> 
>> So I tried clicking on the "2" in stratum 2, since it was underlined (and 
>> that means can be graphed in my experience up until today) and got this 
>> error:
>> 
>> Unable to create new chart.
>> 
>> Data set ID 'v13ed#NtpS' is invalid.
>> 
>> 
>> but "v13ed@NtpS" doesn't show up anywhere in the probe
>> 
>> So my first question is what am I missing that the probe can display this 
>> detail without a section that handles that?
>> 
>> my second question is whether or not someone else has already done this, 
>> since it's apparently not as simple as it looked.
>> 
>> Ideally I could have some kind of probe that queried our three stratum 2 
>> servers, and went into alarm state if one of their clocks was way off.  or 
>> at least let me alarm on the value being printed for "Stratum:" 
>> 
>> 
>> Here's all the probe file had in it:
>> 
>> <!-- 
>>      NTP (com.dartware.ntp)
>>      Copyright © 2000 Dartware, LLC. All rights reserved.
>> -->
>> 
>> <header>
>>      type                    =       "built-in"
>>      package                 =       "com.dartware"
>>      probe_name              =       "ntp"
>>      human_name              =       "Network Time"
>>      version                 =       "1.5"
>>      address_type    =       "IP"
>>      port_number             =       "123"
>>      
>>      old_protocol    =       "16"            # Backward compat. with old 
>> numbering scheme.
>>      old_script              =       "0"
>> 
>>      display_name    =       "Servers-Standard/Network Time"
>> 
>> </header>
>> 
>> <description>
>> 
>> \GB\Network Time Protocol - Version 2 (NTP)\P\
>> 
>> The protocol used to synchronize time between computers, defined in 
>> \u2=http://www.ietf.org/rfc/rfc1119.txt\RFC 1119\p0\. 
>> 
>> This probe sends a client-mode request to the NTP server asking for the 
>> current time. By default, NTP requests are sent to UDP port 123.
>> 
>> </description>
>> 
>> <parameters>
>> 
>> # No Parameters
>> 
>> </parameters>
>> 
>> 
>> -- 
>> -debbie
>> Debbie Fligor, n9dn       Lead Network Engineer, CITES, Univ. of Il
>> email: [email protected]          <http://www.uiuc.edu/ph/www/fligor>
>>               "My turn."  -River Tam
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> ____________________________________________________________________
>> List archives:
>> http://www.mail-archive.com/intermapper-talk%40list.dartware.com/
>> To unsubscribe: send email to: [email protected]
>> 
> 

-- 
-debbie
Debbie Fligor, n9dn       Lead Network Engineer, CITES, Univ. of Il
email: [email protected]          <http://www.uiuc.edu/ph/www/fligor>
"Every keystroke can be monitored. And the computers never forget."






-- 
-debbie
Debbie Fligor, n9dn       Lead Network Engineer, CITES, Univ. of Il
email: [email protected]          <http://www.uiuc.edu/ph/www/fligor>
                   "My turn."  -River Tam








____________________________________________________________________
List archives:
http://www.mail-archive.com/intermapper-talk%40list.dartware.com/
To unsubscribe: send email to: [email protected]

Reply via email to