ParseLogs
Subscribe

From OpenNMS

Jump to: navigation, search

Sometimes you know you are looking for a particular nodeid in the logs and you only want to see log messages related to that nodeid. This page is intended to capture short CLI commands to just that.

Test on OpenNMS 1.8.4

Collectd.log

TMPNODEID=6; egrep "node\[${TMPNODEID}\]|/${TMPNODEID}/| ${TMPNODEID}:[0-9]{3}" /var/log/opennms/daemon/collectd.log

Grep out info related to that nodeid and a given ip address

TMPNODEID=6; TMPNODEIP='192.168.0.3'; egrep "node\[${TMPNODEID}\]|/${TMPNODEID}/| ${TMPNODEID}:[0-9]{3}|${TMPNODEIP}" /var/log/opennms/daemon/collectd.log

Poller.log

Grep out info related only to that nodeid

TMPNODEID=6; egrep "Nodeid ${TMPNODEID}| ${TMPNODEID}/|${TMPNODEID}:[0-9]{3}" /var/log/opennms/daemon/poller.log

Grep out info related to that nodeid and a given ip address

TMPNODEID=6; TMPNODEIP='192.168.0.3'; egrep "Nodeid ${TMPNODEID}|${TMPNODEID}/|${TMPNODEID}:[0-9]{3}|${TMPNODEIP}" /var/log/opennms/daemon/poller.log