Projet

Général

Profil

Révision 12d632ca

ID12d632ca62870ee3ea11a72b17cd8d9f88c576cd
Parent 1dddd2fb
Enfant 29be1c00

Ajouté par Thomas VIAL il y a plus de 12 ans

fping_ => Added file to monitor server/network availability

Voir les différences:

plugins/network/fping_
1
#!/bin/sh
2
#
3
# Plugin to monitor a server/network availability.
4
# Author: Thomas VIAL
5
#
6
# Requirements:
7
# * fping
8
#
9

  
10
target=`basename $0 | sed 's/^fping_//g'`
11
#target='dev.instalbu.ms'
12
#target='127.0.0.1'
13

  
14
if [ "$1" = "config" ]; then
15
  echo "graph_title ${target} availability"
16
  echo "graph_args --upper-limit 100"
17
  echo "graph_vlabel Availability"
18
  echo "graph_category network"
19
  # Success
20
  echo "fping_${target}_success.label Reachable"
21
  echo "fping_${target}_success.type GAUGE"
22
  echo "fping_${target}_success.color 00CC00CC"
23
  # Failure
24
  echo "fping_${target}_failure.label Unreachable"
25
  echo "fping_${target}_failure.type AREA"
26
  echo "fping_${target}_failure.color ff0000"
27
  exit 0
28
fi
29

  
30

  
31

  
32
fping -q $target
33
status=$?
34

  
35
if [ $status -eq 0 ]; then
36
    echo "fping_${target}_success.value 100"
37
    echo "fping_${target}_failure.value 0"
38
else
39
    echo "fping_${target}_success.value 0"
40
    echo "fping_${target}_failure.value 100" 
41
fi

Formats disponibles : Unified diff