Monitoring server resources with SNMP on Icinga2

This forum was archived to /woltlab and is now in read-only mode.
  • Hey all,


    I'm trying to monitor certain server resources (disk space for example) on a host in my network. Running the snmpwalk command, I was able to generate the list of things that can be monitored with SNMP. I am trying to use a certain OID (1.3.6.1.4.1.2021.9.1.9.1, percentage of disk space used), on the host, but Icinga2 errors out with this message:


    External command error: Error in packet
    Reason: (noSuchName) There is no such variable name in this MIB.
    Failed object: iso.3.6.1.4.1.2021.9.1.9.1


    I am assuming this is because the OID does not exist on the host itself, even though it does exists in the MIB directory on my Icinga2 server. I am using the check_snmp plugin included by default in the PluginDir. My command definition is syntactically correct, but can be posted if needed. The service definition looks like so:


    Code: /etc/icinga2/conf.d/services.conf
    1. apply Service "percentage-UsedDiskSpace" {
    2. import "generic-service"
    3. //my check command that I defined using check_snmp
    4. check_command = "check-puds"
    5. //my host's name is NAS-Unit
    6. assign where host.name == "NAS-Unit"
    7. }

    Unsure as to how to go about this. I know that the OID is valid (I looked it up). I am thinking that, as said before, the OID does not exist in the MIB file on the host being monitored.


    Thanks for any help/ideas!


    Note,
    Here's some threads that I read prior to posting this regarding SNMP as well:
    1
    2
    3
    4 (had to translate to English!)

  • Here ya go!



    I changed the name to "check-uds" (short for used disk space) and changed the OID to a different OID that checks for used disk space. This works, but doesn't show the percentage. I am still confused as to why the above OID definition does not work for checking used disk space.


    If you run snmptranslate on this OID, you get this output:


    # snmptranslate 1.3.6.1.2.1.25.2.3.1.6.38
    HOST-RESOURCES-MIB::hrStorageUsed.38


    This is one of the strings that was outputted via running the snmpwalk command in the command line, which tells me that the host (NAS Unit) somehow pulls from the MIB file (HOST-RESOURCES-MIB) to define this particular OID:



    Code
    1. # snmpwalk -v 2c -c ICINGA2 -O e x.x.x.x
    2. ...
    3. HOST-RESOURCES-MIB::hrStorageUsed.38
    4. ...

    This is how I am able to use this OID in my "check-uds" CheckCommand definition. Another thing to note is that if you were to run snmptranslate on the OID that I initially posted (1.3.6.1.4.1.2021.9.1.9.1), it outputs like this:


    # snmptranslate 1.3.6.1.4.1.2021.9.1.9.1
    UCD-SNMP-MIB::dskPercent.1


    This OID is NOT in the snmpwalk output. So, the logical thinking is to say that because the OID is not present in the tt]snmpwalk[/tt] output, it means that this OID shouldn't ever work for this host? I have found a few exceptions to this.


    I found this other OID for showing total free RAM, and when I used snmptranslate:


    # snmptranslate 1.3.6.1.4.1.2021.4.11.0
    UCD-SNMP-MIB::memTotalFree.0


    This one works, and I am currently using it as a different CheckCommand (structured the same as the other one). Notice the MIB file is the same one as the other one that I posted that doesn't work. This makes no sense! Why does this one work and the other doesn't?


    P.S.
    Sorry for the long post. If you got through it, thank you!

  • Hi everyone,


    I'm using "Icinga 1.13.3". I had kind of the same problem "SNMP OK - No Such Instance currently exists at this OID". My problem was on the "snmpd.conf" file from my Centos Server. I added the next lines and now it shows the percentage.


    disk / 10000

    disk /var 5%

    includeAllDisks 10%


    This worked for me, something weird is the my Ubuntu server had this settings by default but the Centos did not. I hope this helps.


    P.S.

    I've installed SNMP on both server(Ubuntu and Centos) the same day.

  • Hey, please do not ressurect such old threads.

    Also take note that those issues, are related to icinga2 and not icinga1

    Linux is dead, long live Linux


    Remember to NEVER EVER use git repositories in a productive environment if you CAN NOT control them

  • Got it. He mentioned "This works, but doesn't show the percentage. I am still confused as to why the above OID definition does not work for checking used disk space." So I would say his issue now is with SNMP rather than Icinga.


    But if it's better to delete my comment, I'll do so. Any suggestion to keep this "solution" (that might help others) documented? I appreciated your job and I just wanted to contribute.

  • Your comment should not be deleted.

    the best way would be to open a new thread, with a proper subject, then write the problem you had and how you solved it.

    This would be the best way.


    I am sorry if my style of writing offended you in any way.

    Linux is dead, long live Linux


    Remember to NEVER EVER use git repositories in a productive environment if you CAN NOT control them

  • No problem, I will create a new thread + the solution that worked for me. It's fine, no worries :D