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.

Tnhks.

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

icinga2error

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?

https://exchange.icinga.com/ozzi-/check_snmp

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

Blockquote
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.)

can help some one i have thish

iso.3.6.1.2.1.2.2.1.8.2 = Integer: 1
iso.3.6.1.2.1.2.2.1.8.1 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.3 = Integer: 1
iso.3.6.1.2.1.2.2.1.8.4 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.7 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.6 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.5 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.9 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.12 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.10 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.8 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.13 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.14 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.15 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.11 = Integer: 1
iso.3.6.1.2.1.2.2.1.8.16 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.17 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.19 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.18 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.20 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.21 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.22 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.24 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.23 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.25 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.26 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.27 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.28 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.29 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.31 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.30 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.33 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.32 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.34 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.35 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.36 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.37 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.39 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.38 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.42 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.41 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.43 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.45 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.44 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.40 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.46 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.47 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.49 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.48 = Integer: 1
iso.3.6.1.2.1.2.2.1.8.50 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.51 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.52 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.53 = Integer: 1
iso.3.6.1.2.1.2.2.1.8.54 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.56 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.55 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.57 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.58 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.60 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.59 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.61 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.62 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.64 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.63 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.66 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.65 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.67 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.68 = Integer: 2
iso.3.6.1.2.1.2.2.1.8.69 = Integer: 2

its port up or donw.

i have thish in isinga2

apply Service "Switch 148" {
    import "Switch Status Port"

    assign where "Status_port_Switch" in host.groups
    vars.snmp_label = "Status_port"
    vars.snmp_oid = "1.3.6.1.2.1.2.2.1.8"
    vars.snmp_timeout = "50"

    import DirectorOverrideTemplate
}

but i have error check_snmp: Could not parse arguments

Whot i du wrong ?

Hi all, i have new problem.

this code dont work.

object Host "sw112.srv103.hp.msk.norsi-trans.ru" {
  import "generic-host"
  address = "127.0.0.1"
  display_name = "swAruba"
  vars.snmp_community = "public"
  vars.snmp_version = "2c"
  vars.snmp_check["GigabitEthernet0/0/1"] = { "id" = "1", "oid" = "1.3.6.1.2.1.2.2.1.13,1.3.6.1.2.1.2.2.1.14,1.3.6.1.2.1.2.2.1.19,1.3.6.1.2.1.2.2.1.20,1.3.6.1.2.1.31.1.1.1.15,1.3.6.1.2.1.2.2.1.8,1.3.6.1.2.1.2.2.1.7,1.3.6.1.2.1.31.1.1.1.6,1.3.6.1.2.1.31.1.1.1.10", "label" = "ifInDiscards,ifInErrors,ifOutDiscards,ifOutErrors,ifHighSpeed,ifOperStatus,ifAdminStatus,ifHCInOctets,ifHCOutOctets", "critical" = ",,,,,1,,," }

Whot i do wrong ?