summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2015-03-30 10:20:48 +0300
committerytti <saku@ytti.fi>2015-03-30 10:20:48 +0300
commit1a33c9671c52345e8d09f2284a07fc2b454c91a0 (patch)
tree937ea0d5ef14a7eccedd3ac89c193b46e3cf30e2
parentd5773ab38c1bc4514be798df618bdafbe26f4f55 (diff)
parent0928ea0509bd89ddf830c4ed64a1fbc845aef01e (diff)
Merge pull request #95 from MrRJ45/patch-1
Add Support for Cisco Devices with VSS
-rw-r--r--extra/syslog.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/extra/syslog.rb b/extra/syslog.rb
index 399cef3..2af83a0 100644
--- a/extra/syslog.rb
+++ b/extra/syslog.rb
@@ -8,6 +8,8 @@
# set system syslog host SERVER interactive-commands notice
# set system syslog host SERVER match "^mgd\[[0-9]+\]: UI_COMMIT: .*"
+# Ports < 1024 need extra privileges, use a port higher than this by passing the first argument a number
+# To use the default port for syslog (514) you shouldnt pass an argument, but you will need to allow this with:
# sudo setcap 'cap_net_bind_service=+ep' /usr/bin/ruby
# exit if fork ## TODO: proper daemonize
@@ -25,7 +27,7 @@ module Oxidized
PORT = 514
FILE = 'messages'
MSG = {
- :ios => '%SYS-5-CONFIG_I:',
+ :ios => /%SYS-(SW[0-9]+-)?5-CONFIG_I:/,
:junos => 'UI_COMMIT:',
}
@@ -73,7 +75,7 @@ module Oxidized
def handle_log log, ip
log = log.to_s.split ' '
- if i = log.index(MSG[:ios])
+ if i = log.find_index { |e| e.match( MSG[:ios] ) }
ios ip, log, i
elsif i = log.index(MSG[:junos])
jnpr ip, log, i