We're moving to a new support system!

The Nagios Answer Hub is a place where you can get help with technical questions from our experts. There, you can quickly open tickets and join discussion boards.

Request Nagios Answer Hub access here: https://info.nagios.com/answer-hub-access-new-users

After completing the access form, you will be given access to a portal where new tickets can be created. We will keep the old customer forum sections and ticket system available for current cases to be resolved.

check_snmp. Multiply or divide the obtained value

Engage with the community of users including those using the open source solutions.
Includes Nagios Core, Plugins, and NCPA

check_snmp. Multiply or divide the obtained value

Postby kchiche18 » Tue Jan 11, 2022 3:15 pm

Good afternoon.
I need to multiply by 0.1 a value obtained with the check_snmp plugin. I have seen that there exists in the source code of Github https://github.com/nagios-plugins/nagios-plugins/blob/master/plugins/check_snmp.c, a parameter:

#define L_MULTIPLIER CHAR_MAX+6

I need to send to "check_snmp" a parameter (for example, -M 0.1) to multiply/divide the value recibied.
How can I do it?

I think to patch "check_snmp" something like this below, comment the constant and substituing by 'M' parameters.
Thanks.

@@ -68,1 +68,1 @@
-#define L_MULTIPLIER CHAR_MAX+6
+/*#define L_MULTIPLIER CHAR_MAX+6*/
@@ -775,1 +775,1 @@
- {"multiplier", required_argument, 0, L_MULTIPLIER},
+ {"multiplier", required_argument, 0, 'M'},
@@ -1015,1 +1015,1 @@
- case L_MULTIPLIER:
+ case 'M':
@@ -1365,1 +1365,1 @@
- printf ("[-a authproto] [-A authpasswd] [-x privproto] [-X privpasswd] [--strict]\n");
+ printf ("[-a authproto] [-A authpasswd] [-x privproto] [-X privpasswd] [-M multiplier] [--strict]\n");
kchiche18
 
Posts: 1
Joined: Tue Jan 11, 2022 1:03 pm

Return to Community Support

Who is online

Users browsing this forum: Google [Bot] and 21 guests