Dear community! I would be grateful if you could help me with my Discovery rule problem.
My aim is to create network interface items with a discovery rule (SNMP agent type) with a name got with come string transformation. The initial interface name (got from IF-MIB::ifDescr) is to long and have some useless information in the left part.
For example: I would like to convert "Avaya Inc., G450 Media Gateway 10/100/1000BaseTx Port 10/5" to "10/100/1000BaseTx Port 10/5". The left part "Avaya Inc., G450 Media Gateway" have to be cutted.
What I had done?
Discovery rules --> Preprocessing --> Preprocessing steps --> Regular expression:
Parameters: Gateway([\s\S]*)
Output: /1
The result of Test is apsolutely what I axpected. But when I apply discovery I got next error message:
"Invalid discovery rule value: cannot parse as a valid JSON object: invalid object format, expected opening character '{' or '[' at: ', SW Version 36.18.30","{#IFSPEED}":"0","{#IFADMST}":"1","{#IFA DMOPST}":"1"},{"{#SNMPINDEX}":"167774723","{#IFNO} ":"167774723","{#IFDES}":"Avaya Inc.,"
Maybe I'm trying to go the wrong way? How could I cut a part of OID's output before it will be used to create an Item from an item prototype?
Thank you.
Regards,
f1g2
Here snmpwalk output of discovering OIDs:
IF-MIB::ifDescr.16777216 = STRING: Avaya Inc., G450 Media Gateway, SW Version 36.18.30
IF-MIB::ifDescr.167774723 = STRING: Avaya Inc., G450 Media Gateway, 10/100Base-Tx, FastEthernet 10/3
IF-MIB::ifDescr.167774724 = STRING: Avaya Inc., G450 Media Gateway, 10/100Base-Tx, FastEthernet 10/4
IF-MIB::ifDescr.211841025 = STRING: Avaya Inc., G450 Media Gateway, Vlan, Vlan 1
IF-MIB::ifDescr.251660805 = STRING: Avaya Inc., G450 Media Gateway 10/100/1000BaseTx Port 10/5
IF-MIB::ifDescr.251660806 = STRING: Avaya Inc., G450 Media Gateway 10/100/1000BaseTx Port 10/6
IF-MIB::ifDescr.268438024 = STRING: Avaya Inc., G450 Media Gateway, Console port, Console-Modem
IF-MIB::ifDescr.788531712 = STRING: Avaya Inc., G450 Media Gateway, USB port, USB-Modem
IF-MIB::ifDescr.855640576 = STRING: Avaya Inc., G450 Media Gateway, PPP Session, USB-Modem
IF-MIB::ifDescr.855640584 = STRING: Avaya Inc., G450 Media Gateway, PPP Session, Console
IF-MIB::ifDescr.872417792 = STRING: Avaya Inc., G450 Media Gateway, External USB Modem, USB-Modem
IF-MIB::ifDescr.872417800 = STRING: Avaya Inc., G450 Media Gateway, External serial Modem, Console
IF-MIB::ifDescr.889195019 = STRING: Avaya Inc., G450 Media Gateway, 10/100Base-Tx, Services



My aim is to create network interface items with a discovery rule (SNMP agent type) with a name got with come string transformation. The initial interface name (got from IF-MIB::ifDescr) is to long and have some useless information in the left part.
For example: I would like to convert "Avaya Inc., G450 Media Gateway 10/100/1000BaseTx Port 10/5" to "10/100/1000BaseTx Port 10/5". The left part "Avaya Inc., G450 Media Gateway" have to be cutted.
What I had done?
Discovery rules --> Preprocessing --> Preprocessing steps --> Regular expression:
Parameters: Gateway([\s\S]*)
Output: /1
The result of Test is apsolutely what I axpected. But when I apply discovery I got next error message:
"Invalid discovery rule value: cannot parse as a valid JSON object: invalid object format, expected opening character '{' or '[' at: ', SW Version 36.18.30","{#IFSPEED}":"0","{#IFADMST}":"1","{#IFA DMOPST}":"1"},{"{#SNMPINDEX}":"167774723","{#IFNO} ":"167774723","{#IFDES}":"Avaya Inc.,"
Maybe I'm trying to go the wrong way? How could I cut a part of OID's output before it will be used to create an Item from an item prototype?
Thank you.
Regards,
f1g2
Here snmpwalk output of discovering OIDs:
IF-MIB::ifDescr.16777216 = STRING: Avaya Inc., G450 Media Gateway, SW Version 36.18.30
IF-MIB::ifDescr.167774723 = STRING: Avaya Inc., G450 Media Gateway, 10/100Base-Tx, FastEthernet 10/3
IF-MIB::ifDescr.167774724 = STRING: Avaya Inc., G450 Media Gateway, 10/100Base-Tx, FastEthernet 10/4
IF-MIB::ifDescr.211841025 = STRING: Avaya Inc., G450 Media Gateway, Vlan, Vlan 1
IF-MIB::ifDescr.251660805 = STRING: Avaya Inc., G450 Media Gateway 10/100/1000BaseTx Port 10/5
IF-MIB::ifDescr.251660806 = STRING: Avaya Inc., G450 Media Gateway 10/100/1000BaseTx Port 10/6
IF-MIB::ifDescr.268438024 = STRING: Avaya Inc., G450 Media Gateway, Console port, Console-Modem
IF-MIB::ifDescr.788531712 = STRING: Avaya Inc., G450 Media Gateway, USB port, USB-Modem
IF-MIB::ifDescr.855640576 = STRING: Avaya Inc., G450 Media Gateway, PPP Session, USB-Modem
IF-MIB::ifDescr.855640584 = STRING: Avaya Inc., G450 Media Gateway, PPP Session, Console
IF-MIB::ifDescr.872417792 = STRING: Avaya Inc., G450 Media Gateway, External USB Modem, USB-Modem
IF-MIB::ifDescr.872417800 = STRING: Avaya Inc., G450 Media Gateway, External serial Modem, Console
IF-MIB::ifDescr.889195019 = STRING: Avaya Inc., G450 Media Gateway, 10/100Base-Tx, Services
Comment