Hello,

I am extracting a software version value through SNMP and would like to remove a dash in the returned value. The SNMP oid returns a value in this format: 1000-2000 and I would like to remove the dash so that I can use the output in a sensor factory sensor.

The scenario is like this: We have a test firewall on which we use rest api calls to extract the installed and latest software versions through xml, this works fine. In the xml rest sensor I can use the option "Characters to remove" and specify the dash, this works perfectly.

But my issue arises when I want to match the extracted latest software version against a value which I extracted from our production firewalls through SNMP. We would like to avoid using the rest api on the production devices because some performance and security issues arise when using the rest api.

So in short my question is: Can I easily remove the dash in between two number outputted by an SNMP oid? (So 1000-2000 should become 10002000)

My regular expression knowledge is very limited, I can separate both numbers in two capture groups but I need both numbers, not one half of the full version number. As far as my understanding goes I would need a replace regex construction to achieve my desired result or is there an easier solution?


Article Comments

Hello,

thank you very for your KB-Post. I'm very sorry, this is not possible in PRTGs native sensors in the moment. Please use a Custom Exe/Script Sensor to do this.

best regards.


Oct, 2013 - Permalink

PTF.SNMPGet

This is possible with new Custom Sensor SNMPGet

The sensor retrieves the OID value using SNMP and filters the result by removing given characters.

Parameters used:

-s=    IP or hostname of the device to check.
-o=    The OID to get the value from
-c=    Optional, community string, default=public.
-v=    Optional, SNMP version (1,2,3), default=1.
-rc=   Optional, characters to remove from the OID return value.

The sensor can be downloaded from this page.


Oct, 2013 - Permalink