summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorMrRJ45 <couton@gmail.com>2015-03-30 08:10:15 +0100
committerMrRJ45 <couton@gmail.com>2015-03-30 08:10:15 +0100
commit0928ea0509bd89ddf830c4ed64a1fbc845aef01e (patch)
tree937ea0d5ef14a7eccedd3ac89c193b46e3cf30e2 /extra
parentd5773ab38c1bc4514be798df618bdafbe26f4f55 (diff)
Add Support for Cisco Devices with VSS
Devices with VSS enabled log Configuration Changes as "%SYS-SW1-5-CONFIG_I" where "SW1" is an identifier of the device in the stack that it came from. (Also added a bit of information of port numbers)
Diffstat (limited to 'extra')
-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