Brand new user evaluating Nagios XI. Running on CentOS 7 in AWS and testing monitoring appliances in our physical data center.
I have a physical appliances that puts several values in a single OID return and you cannot poll for the values individually.
The return results are in the following format:
VALUE1 Value1Name / VALUE2 Value2Name/ VALUE3 Value3Name
VALUE1 = integer
VALUE2 = Integer
VALUE3 = percent
How can I parse these values out of the return value in Nagios XI?
Parsing SNMP Values
Re: Parsing SNMP Values
If you are using the check_snmp plugin, there is an option to separate the output on Multiple OID requests.
Try that and see if this is what you are looking for.-D, --output-delimiter=STRING
Separates output on multiple OID requests
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Parsing SNMP Values
Thanks. Unfortunately I tried that and it was not granular enough - I would still have to use Regex parse values out afterwards. It may work in some of my simpler cases, but the one I am working on now is a bit hairier.
I have figured out the Regex to apply to the query results that will pull the values out that I need. My question now evolves to: In Nagios how can I apply my Regex to the SNMP return values such that they can be used for alerting and historical metrics?
I have figured out the Regex to apply to the query results that will pull the values out that I need. My question now evolves to: In Nagios how can I apply my Regex to the SNMP return values such that they can be used for alerting and historical metrics?
Re: Parsing SNMP Values
Can you post the command you are using and what the output of it running?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Parsing SNMP Values
The return I am getting is:
SNMP OK - "idle_time:7688310600 /system_time:38042110 / user_time:129321130/total avg cpu load:1.27% per 30s" |
I want to parse out the three NAME:VALUE pairs separated by the '/'.
(?<=\/)(.*?)(?=\/) pulls out system_time and user_time
(?<=")(.*?)(?=\/) pulls out only idle_time
Initially I was just trying to grab the values, but I think it would be better to pull the full NAME:VALUE pairs, which seems like a better solution, but a more complicated regex.
BUT....in thinking this through - is there a way to tell Nagios how to identify the NAME:VALUE pairs in polling results so it will automatically parse them out? That seems like a simpler solution.
SNMP OK - "idle_time:7688310600 /system_time:38042110 / user_time:129321130/total avg cpu load:1.27% per 30s" |
I want to parse out the three NAME:VALUE pairs separated by the '/'.
(?<=\/)(.*?)(?=\/) pulls out system_time and user_time
(?<=")(.*?)(?=\/) pulls out only idle_time
Initially I was just trying to grab the values, but I think it would be better to pull the full NAME:VALUE pairs, which seems like a better solution, but a more complicated regex.
BUT....in thinking this through - is there a way to tell Nagios how to identify the NAME:VALUE pairs in polling results so it will automatically parse them out? That seems like a simpler solution.
-
dwhitfield
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Parsing SNMP Values
What is the command you are running? Can you PM me your Profile? You can download it by going to Admin > System Config > System Profile and click the ***Download Profile*** button towards the top. If for whatever reason you *cannot* download the profile, please put the output of View System Info (5.3.4+, Show Profile if older) in the thread (that will at least get us some info). This will give us access to many of the logs we would otherwise ask for individually. If security is a concern, you can unzip the profile take out what you like, and then zip it up again. We may end up needing something you remove, but we can ask for that specifically.
After you PM the profile, please update this thread. Updating this thread is the only way for it to show back up on our dashboard.
After you PM the profile, please update this thread. Updating this thread is the only way for it to show back up on our dashboard.
Re: Parsing SNMP Values
I resolved this myself. I needed a wrapper to put the metrics in nagios format. You can lock this thread.
-
kyang
Re: Parsing SNMP Values
Glad you were able to solve this! We will be closing this topic as resolved!
If you have more questions, feel free to create another thread!
Thank you for using the Nagios Support Forum!
If you have more questions, feel free to create another thread!
Thank you for using the Nagios Support Forum!