Ad Widget

Collapse

Client side parameters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PtY
    Junior Member
    • Mar 2014
    • 10

    #1

    Client side parameters

    Dear Guys,

    I have some (perhaps usable by others too) UserParameters for monitoring Linux servers, and I want to share them.
    If you have too, you can share them too in this thread.
  • PtY
    Junior Member
    • Mar 2014
    • 10

    #2
    NTP time parameters

    Code:
    UserParameter=time.correction,offset=$(/usr/bin/ntpq -pn | /bin/egrep '^\*' | /usr/bin/awk '{ print $9 }'); [ -z "$offset" ] && offset=1000; /bin/echo "$offset"
    Works with Ubuntu (Precise LTS), and give back the time precision to the last sinchronized remote host in milliseconds. If some problem given, the value will be 1000 (1s).

    Code:
    UserParameter=time.stratum,stratum=$(/usr/bin/ntpq -c rv | /bin/egrep -o 'stratum=[0-9]+' | /usr/bin/cut -d'=' -f2); [ -z "$stratum" ] && stratum=17; /bin/echo "$stratum"
    Works with Ubuntu (Precise LTS), and give back the client's stratum status - or 17 if got some problem.

    Comment

    • PtY
      Junior Member
      • Mar 2014
      • 10

      #3
      Ubuntu software updates

      If you have installed update-notifier-common, then apt check can give back the number of possible updates and security updates.

      Code:
      UserParameter=system.updates,num=$(/usr/lib/update-notifier/apt-check 2>&1 | /usr/bin/cut -d';' -f1); [ -z "$num" ] && num=100; /bin/echo "$num"
      This gives back the number of all updates (or 100 if error). Suggested severity: warn, if >0

      Code:
      UserParameter=system.updates.sec,num=$(/usr/lib/update-notifier/apt-check 2>&1 | /usr/bin/cut -d';' -f2); [ -z "$num" ] && num=100; /bin/echo "$num"
      This gives back the number of security updates (or 100 if error). Suggested severity: average if >15

      Comment

      Working...