sensu-plugins-check-lan 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/check-check-lan.rb +9 -9
- data/lib/sensu-plugins-check-lan/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcc5167368ca6cf62ef1ab0144d59f5a62167d83
|
4
|
+
data.tar.gz: dd081d93b7c21ca44472f29e988b9946f8ee3beb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fd2864cd7cf3c2462a52766765689e41708a5fb689ac2453922e90ae54f7f9ea09395d6a602a5f7ad7990ff051335b9ce4fea0510cc9633e30aaf8810b0caa8
|
7
|
+
data.tar.gz: 8de3a63c81eefc268fc94d9abf131bc2828829a5973b5cdb93b68efeb952de81a23a88cc3bdd33deb98215918b0f24b0d285a04ef90bd3bed163c701b6bf307a
|
data/bin/check-check-lan.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
# check-lan
|
4
4
|
#
|
5
5
|
# DESCRIPTION:
|
6
|
-
# This plugin
|
6
|
+
# This plugin checks (standalone) if a given ip is reachable and if it is not restarts the given interface.
|
7
7
|
# If this is not successfull this plugin reboots the client machine.
|
8
8
|
#
|
9
9
|
# OUTPUT:
|
@@ -44,22 +44,22 @@ class CheckLan < Sensu::Plugin::Check::CLI
|
|
44
44
|
|
45
45
|
def run
|
46
46
|
|
47
|
-
puts "ping #{IP_TO_PING} for checking conectivity..."
|
47
|
+
#puts "ping #{IP_TO_PING} for checking conectivity..."
|
48
48
|
ping()
|
49
49
|
if $?.exitstatus >= 1
|
50
|
-
puts "#{INTERFACE} seems to be down, trying to bring it up..."
|
51
|
-
puts "executing ifdown #{INTERFACE}"
|
50
|
+
#puts "#{INTERFACE} seems to be down, trying to bring it up..."
|
51
|
+
#puts "executing ifdown #{INTERFACE}"
|
52
52
|
`sudo #{IFDOWN} #{INTERFACE} `
|
53
|
-
puts "waiting 10 seconds to bring #{INTERFACE} up..."
|
53
|
+
#puts "waiting 10 seconds to bring #{INTERFACE} up..."
|
54
54
|
`sleep 10`
|
55
|
-
puts "executing ifup #{INTERFACE}"
|
55
|
+
#puts "executing ifup #{INTERFACE}"
|
56
56
|
`sudo #{IFUP} #{INTERFACE}`
|
57
|
-
puts "waiting 10 seconds to ping again..."
|
57
|
+
#puts "waiting 10 seconds to ping again..."
|
58
58
|
`sleep 10`
|
59
|
-
puts "ping server again..."
|
59
|
+
#puts "ping server again..."
|
60
60
|
ping()
|
61
61
|
if $?.exitstatus >= 1
|
62
|
-
puts "#{INTERFACE} is still down, REBOOT to recover..."
|
62
|
+
#puts "#{INTERFACE} is still down, REBOOT to recover..."
|
63
63
|
`sudo reboot`
|
64
64
|
critical "REBOOT to recover"
|
65
65
|
else
|