Check_snmp required parameter: secname

Hello together,

first of all i hope i hit the correct board. I was absent for some years :slight_smile:

I have set up a new Icinga server and the majority of the checks should be queried via SNMP.

I also use Icinga Director.

I have created a template based on this tutorial: https://icinga.com/docs/icinga-director/latest/doc/16-Fields-example-SNMP/.

However, the check runs into an error, the secname (SNMPv3 user) is apparently not taken over and I get the message: “required parameter: secname”.

error

These are my data fields for the SNMP values to be passed.

datafields

Does anyone have an idea where the error lies? Did I take a wrong turn somewhere?

Finally, the information I need about the system.

Icinga Deamon
deamon

Featurelist
features

Icinga Version
icinga_version

Icingaweb
icingaweb

Linux
linux

Best regards from Berlin

Mario

HI Mario,

have you specified the SNMP user? Is the SNMP interface correctly configured on the host? Can you send me your query under the “inspect” tab?

As a query test I would recommend to send the SNMP query via the console.

Best regard from Germany!

Hi ShowMeYourSkill,

thx for your response.

the SNMP User is specified:

grafik

As i said, i was absent from Icinga for some years and some things I still miss…

Can u help me where i find the “Inspect” Tab?

Also i struggle a bit with the commands directly from CLI.

But i was able to do the snmpget.

grafik

If i can give you more information, i will provide them :slight_smile:

Best regards,

Mario

You can find the Inspect tab by going to the host and then scrolling down. From the location you can find it via Modify. What console output did you have after doing the SNMP query?

By the way, you can get help on executing CLI commands by changing to your plugin directory /usr/lib/nagios/plugins and executing the command with ./check_snmp_check -h. In most cases a help window will open with all available information, e.g. -H for the hostname.

Hi ShowMeYourSkil,

sorry for the delay, but im only 2 days a week in the office.

i think i got what u requested:

Here the inspection:

Dont worry about the SNMP Passwords… these are only for testing :slight_smile:

inspect1

inspect2

And here is the output from the commandline when i fire the command manually, which works as aspected:

root@monitor01:/usr/lib/nagios/plugins# ./check_snmp -H 172.16.10.191 -U icinga4 -a SHA -A "12345678" -x AES -X "12345678" -o .1.3.6.1.4.1.2356.800.3.2312.1.1.1.0
SNMP OK - "LANCOM GS-2310P+" |
root@monitor01:/usr/lib/nagios/plugins#

I think somewhere in my variables is the error.

Well i did some testings around… and my first output from the CLI is wrong.

I had snmpv2 still enabled and so i got my result.

I had disabled now snmpv2 on the switch and have only 2 Users for my snmpv3 testings:

grafik

So back again on the CLI… i fired the following command and now i got a new error:

root@monitor01:/usr/lib/nagios/plugins# ./check_snmp -H 172.16.10.191 -o .1.3.6.1.4.1.2356.800.3.2312.1.1.1.0 -P 3 -L authPriv -a SHA -x AES -U "icinga4" -A "12345678" -X "12345678"
External command error: Error in packet
Reason: (genError) A general failure occured
root@monitor01:/usr/lib/nagios/plugins# ./check_snmp -H 172.16.10.191 -o .1.3.6.1.4.1.2356.800.3.2312.1.1.1.0 -P 3 -L authPriv -a SHA -x AES -U "tonitest" -A "diesisteintest" -X "diesisteintest"
External command error: Error in packet
Reason: (genError) A general failure occured
root@monitor01:/usr/lib/nagios/plugins#

Im getting mad :slight_smile:

I also looked into the check and the variables there are like:

"-o" = {
            description = "Object identifier(s) or SNMP variables whose value you wish to query"
            value = "$snmpv3_oid$"

So i changed my variables to $variable$:

grafik

I created a single service and provides the snmp information:

grafik

which looks in the preview like this:

grafik

Inspecting the host shows this…

grafik

I am missing the specified OID here from my single service.

The output does not show the error again, but now its missing the OID.
grafik

I think I’ve already made a step forward and now it’s just a matter of one small thing to get the right output.

Does anyone have an idea what I’m stuck on now, or in other words, why the OID that was defined is not being passed?

Best Regards
Mario

I will leave everything I have written so far as it is for the records :slight_smile:

The information in my 2 postings today are to be considered outdated, as I have removed everything I have tried so far.

I have rebuilt the data lists and data fields. I again followed these instructions: https://icinga.com/docs/icinga-director/latest/doc/16-Fields-example-SNMP/

However, I renamed the variables to the variables in the check_snmp description.

DataFields:
grafik

DataList:
grafik

I have now created a service template that refers to the check command snmpv3.
grafik

Here I have created a data field for the snmpv3_oid.
grafik

Now I have created a service for querying the model name:

grafik

But i still get the same error again:

grafik

So with the hints from ShowMeYourSkil… i found now the right Inspectbutton.

Here the Check-Result:
Executed Command:

'/usr/lib/nagios/plugins/check_snmp' '-A' 'diesisteintest' '-H' '172.16.10.191' '-L' 'authPriv' '-P' '3' '-U' 'tonitest' '-X' 'diesisteintest' '-a' 'SHA' '-o' '.1.3.6.1.4.1.2356.800.3.2312.1.1.1.0' '-t' '10' '-x' 'AES'

It looks like all variables are taken from the host, as well as from the service.
grafik

grafik

However, I find the order in which the execution command was put together very strange.

Is it possible to influence this?
Is this possibly my problem?

Best regards

Mario

Hello folks,

back on the CLI i tried it again, first i inspected what check_snmp wants:

Usage:
check_snmp -H <ip_address> -o <OID> [-w warn_range] [-c crit_range]
[-C community] [-s string] [-r regex] [-R regexi] [-t timeout] [-e retries]
[-l label] [-u units] [-p port-number] [-d delimiter] [-D output-delimiter]
[-m miblist] [-P snmp version] [-N context] [-L seclevel] [-U secname]
[-a authproto] [-A authpasswd] [-x privproto] [-X privpasswd] [-4|6]

So i did a command in the editor like this:

./check_snmp -H 172.16.10.191 -o .1.3.6.1.4.1.2356.800.3.2312.1.1.1.0 -P 3 -L authPriv -a SHA -x AES -U support -A supportfall -X supportfall

The result:

External command error: Error in packet
Reason: (genError) A general failure occured

Does anyone have a working SNMPv3 query?
I’m running out of things to test.

There is no problem with SNMPv2c, but I am supposed to implement it via SNMPv3.

I’ll continue my OID queries via SNMPv2 for now, but I might need helping hands here again to convert it to SNMPv3 then :slight_smile:

Best Regards

Mario

Why do you specify the OID yourself? In my SNMO V3 queries I ask for the password and the private password and of course the username.

unfortunately, i’m not sure where we left off because i’m currently involved in many icinga projects myself. Do you get a callbach from snmpv3 via the CLI :wink:

Hi ShowMeYourSkil,

I don’t quite understand what you mean here. But thanks for your help and patience with me :slight_smile:

I need to put an OID in my checks so that Icinga knows what to query. I have created a service template where there is a single field with the variable for the OID.
grafik

grafik

I then use this template in a single service.

grafik

The last thing you asked me about was the output on the CLI, inspecting the service.

Since I had thrown overboard everything I had so far, with the post of April 28, I described again everything how I did it again.

This is also the state I have today. I have only now in parallel also created a SNMPv2 template, which also works, so that I can prepare the next checks at least already times, so that I can show progress to my boss.

As you can see I am still stumbling around here.

Greetings from Berlin

Mario

do you use this script?
check_snmp :: Icinga Exchange

I dont think so.

Im using the external command which comes with Icinga 2

grafik

grafik