Ben Stienstra

Linux, Unix, network, radio and more...

User Tools

Site Tools


ntp_pzf_splunk

Splunk - retrieve NTP PZF stats script

  • Create script and use as input for splunk:
    #!/bin/bash
    
    #this script needs the moreutils package
    
    ntpserver="ntp1.domain.tld"
    community="<your community string>"
    version="2c"
    
    /bin/snmpget -OsQ -v $version -c $community $ntpserver \
    	mbgLtNgRefclockStatusA.1 \
    	mbgLtNgRefclockStatusB.1 \
    	| tr -d " " | ts
  • Example output:
    $ ./get-pzf-stats.sh
    Jan 07 23:45:59 mbgLtNgRefclockStatusA.1=96
    Jan 07 23:45:59 mbgLtNgRefclockStatusB.1=99
ntp_pzf_splunk.txt · Last modified: 2015/01/07 22:47 by admin