Simplify and fix Cisco ios,iosxe,catos syslog processing #3099

Merged
merged 7 commits into from Mar 3, 2016

Projects

None yet

4 participants

@murrant
Contributor
murrant commented Feb 26, 2016

This should cover the examples I could find on the web, but we could be missing some corner cases.
If we fail, the entire message is in msg, instead of being lost.

Fixes #2205

@murrant murrant Simplify Cisco ios,iosxe,catos log processing.
This should cover the examples I could find on the web, but we could be missing some corner cases.
If we fail, the entire message is in msg, instead of being lost.
d1f44ae
@murrant murrant changed the title from Simplify Cisco ios,iosxe,catos log processing. to Simplify and fix Cisco ios,iosxe,catos log processing. Feb 26, 2016
@murrant murrant changed the title from Simplify and fix Cisco ios,iosxe,catos log processing. to Simplify and fix Cisco ios,iosxe,catos syslog processing Feb 26, 2016
@Ultra2D
Contributor
Ultra2D commented Feb 26, 2016

First off, I don't manage any devices affected by this, only interested in the syslog parsing (see #3036) and origin of the old code so to speak.
If I understand correctly, the edge cases are:

  • messages that do not start with % [1], could be fixed by changing '/^% to '/^%?
  • Message Traceback Reports [2]: -Process= and -Traceback=
  • message within a message, for some unknown reason only the slot message was logged as program [2]:
    "Some messages also indicate the card and slot that are reporting the error. These messages begin with a percent sign (%) and are structured as follows:"
    %CARD-SEVERITY-MSG:SLOT %FACILITY-SEVERITY-MNEMONIC: Message-text

[1] http://www.cisco.com/c/en/us/support/docs/switches/catalyst-6000-series-switches/29804-186.html
[2] http://www.cisco.com/c/en/us/td/docs/ios/system/messages/guide/consol_smg/sm_cnovr.html

@murrant
Contributor
murrant commented Feb 26, 2016

Thanks @Ultra2D. I thought I had %? in there at some point, must have snuck out. I'll go through these later.

@murrant
Contributor
murrant commented Feb 29, 2016

@librenms/reviewers Any thoughts on this?

@laf
Member
laf commented Feb 29, 2016

Still nervous about things like this as we just don't 100% know the impact for people :/

If we were to merge, I'd propose a message out via the notifications.xml to let people know.

@murrant
Contributor
murrant commented Feb 29, 2016

Maybe, it has been totally broken for my Cisco devices since I set it up on my production server. All I get is % in the logs.

@murrant
Contributor
murrant commented Feb 29, 2016

Unit tests would help, but I have no idea how to set that up.

@laf
Member
laf commented Mar 2, 2016

If you just add a new entry to misc/notifications.xml and add a new entry just saying that we've merged this in and if you use syslogging with cisco kit then keep an eye on it.

murrant added some commits Mar 3, 2016
@murrant murrant move the negation outside of the regular expression for more accurate…
… results
ea491c4
@murrant murrant The old load included the leading %. Stick with that behavior. f52954f
@murrant murrant PHPunit tests for Cisco syslog parsing.
734d1bc
@murrant murrant Notifcation and tab->spaces fix.
2af1b51
@murrant murrant Enable phpunit testing in Travis CI.
985ea9b
@laf laf merged commit fa23fc4 into librenms:master Mar 3, 2016

2 checks passed

Auto-Deploy Build finished. No test results found.
Details
Scrutinizer 5 new issues, 4 updated code elements
Details
@murrant murrant deleted the murrant:syslog-cisco branch Mar 3, 2016
@Ultra2D
Contributor
Ultra2D commented Mar 4, 2016

@murrant There is a single tab character on line 86 of tests/SyslogTest.php. Could you convert it to spaces?

@laf
Member
laf commented Mar 4, 2016

This pr has been merged so it would need to be a separate pr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment