Director + Snmp

Hi all, i have some problem whit Direct + snmp.

Can’t find normal example how i can give information from oid used Direct + snmp.

Can some one help me, whit my problem.


I assume you already checked there, but there is a section in the docs about this Fields Example Snmp - Icinga Director

in this nou example how used oid (

have this error.

used check_snmp


How fix this error ?

The error message notes that there is no host specified, it might help if you share how you configured your check.
I assume that you’re using this, did you read the documentation?

yes, i read it

here is my settings

I give u screen my settings.

U can help me ?

I can’t see a command definition, nor a service template “PDU Input Voltage” where you then import that definition. The command definition has a command field that basically describes how the command is called up. It looks like you are missing an argument there.

Whot it this command definition ?

And where i must add it ?

in this link check_snmp :: Icinga Exchange nothing abaut command definition

Since you seem to be using the Director: Click on it in the GUI, then choose Commands, then again Commands. There you will see a list of self-defined command definitions. You have to add one for your new command to become usable in your other definitions.

The “check-snmp” mentioned in your example is obviously not the same as your command itself! (Dash vs. underscore in the name!) It is the command definition that is assumed that you have already set up.

Look at the the other definitions already there for hints of how to do it. In essence though, in the command field you need to specify the command as call-up-able in the bash - with full path specified for the actual plugin name - replacing some fixed arguments or option arguments with variables containing your target host address, SNMP community string, and so on. I suggest you in fact start by making the shell level command line do what you want; then use that to set up the command in your new “check-snmp” command definition.

You may also already have an external command definition “check-snmp”, i.e. of plugins already included in the Icinga2 installation and for which variable names etc. are already specified; check under Commands → External Commands in the Director. If so, let us know, and we will briefly go into how to make use of external commands…

P.S.: I just saw only now that you already seem to have set up a normal (not external) command definition “check_snmp” from your first bigger screen capture picture in your 3rd post above. How about showing the “Command” tab of that command definition please; also add the Preview tab of that!

P.P.S. (late edit): A “command definition” is also mentioned in your linked example, if you scroll all the way to the bottom. Probably using a direct .conf file, though, i.e. not via Director. It is BTW not a good idea to mix direct .conf usage and Director configuration, unless you know exactly what you are doing; as a beginner, choose one or the other method for configuration, for everything.

Wow! You are using the self-defined command like an external command, doing everything via arguments. BUT: That argument list that you have there (1st screen capture picture in your last post) means that ALL those arguments are being set up separated by spaces every time your check plugin is called up! So all those variables you use there would also need to be filled (e.g. $snmp_address$, which you have not defined as a field - use just $address$ instead on that “-H” argument row! (Std. Icinga variable for the host address))!!

Better to get rid of those argument rows in the Arguments tab, that you don’t intend to use! So that you don’t have to define all those variables/“fields”, which are currently inserted as empty strings in your long arguments list on call-up…

P.S.: As I said, start from how you would call up your plugin in the shell. Then build only those option( argument)s into your command definiton, using variables/“fields” for values that may change from host to host.

can u writen me exampl how it must be ?

if u can creat exampl in director.

After all these settings, monitoring of various devices through snmp oid should work

I don’t have any more time today, but we can go through a much simpler definition via Director tomorrow shortly after noon: New command definiton, new service template, new service, then allocate this to the host. Let me know clearly if you agree.

In the mean time, if at all possible, pls. find out how to call up your plugin command, with full path, from the bash of the Icinga2 server for the remote host, so that it gives you the correct output and exit code there.

Now i have this error

Error: Non-optional macro ‘snmp_version’ used in argument ‘-P’ is missing.

(As I said, you need to define (& then set) the variables/“fields” you are using in your Arguments tab! – But now I’m signing off… Till tomorrow IF I hear from you that you want to go the new way.)