New to Kiwi Syslog and scripting in general. I am trying to develop a script or a method within kiwi to take the incoming snmp message and then display and log the following components of the message. Any help would be appreciated.
Thanks
Step 1: To take the “commonMIBSeverity=value” parameter in the message and remap using the following scale and then replace the existing value in the Priority field.
Scale = 1-Critical; 2-Major; 3-Minor; 4-Warning; 5-Info; 6-Undetermined ; 7-Cleared
Step 2: remove all unwanted data in the message retaining just the values for mmonMIBComponentID= and commonMIBErrCode= and commonMIBAlarmData=
Example1
Input:
2016-04-12 12:04:37 Local7.Debug pbxmslaba00 generic_name="Coldstart", commonMIBSeqNumber=392108, commonMIBDateAndTime=<007>…<004><012><012><004>&<000>, comonMIBSeverity=2, commonMIBComponentID=CS1000E(lab):Zeeland:CS, commonMIBNotificationID=0, commonMIBSourceIPAddress=pbxmslaba00, commonMIBErrCode=DCH054,
commonMIBAlarmType=8, commonMIBProbableCause=202, commonMIBAlarmData="DCH: 232 EST CONFIRM TIME: 12:04:37 12/04/2016 "
Result:
2016-04-12 12:04:37 Major pbxmslaba00 CS1000E(lab):Zeeland:CS, DCH054, "DCH: 232 EST CONFIRM TIME: 12:04:37 12/04/2016 "
Example 2
Input:
2016-04-12 12:04:07 Local7.Debug pbxmslaba00 generic_name="Coldstart", commonMIBSeqNumber=392107, commonMIBDateAndTime=<007>…<004><012><012><004><008><000>,
commonMIBSeverity=1, commonMIBComponentID=CS1000E(lab):Zeeland:CS, commonMIBNotificationID=0, commonMIBSourceIPAddress=pbxmslaba00, commonMIBErrCode=ELAN014,
commonMIBAlarmType=8, commonMIBProbableCause=202, commonMIBAlarmData="ELAN 0 host IP=slgemslaba01 is enabled"
Result:
2016-04-12 12:04:07 Critical pbxmslaba00 CS1000E(lab):Zeeland:CS, ELAN014, ELAN 0 host IP=slgemslaba01 is enabled"