check_ide_smart

This forum was archived to /woltlab and is now in read-only mode.
  • I've written this service for check_ide_smart plugin:

    apply Service "smarttest" {

    import "generic-service"

    check_command = "check_ide_smart"

    vars.device = "/dev/sdh"

    assign where host.name == NodeName

    }

    but icingaweb2 gives me this message:


    Plugin Output

    CRITICAL - Couldn't open device /dev/sdh: Permission denied


    I've also added user nagios to sudo, but it didn't help either... On this host I have icinga2 version: r2.7.1-1 running on Debian Jessie, and my master node runs version: r2.6.3-1

    Also I have set the service on the client not master.

    is there anything that I'm doing wrong? any help/suggestions would be appreciated.

    Thanks,

  • Hi,


    did you write an own CheckCommand definition for the plugin? If yes this was not necessary, inside the Icinga Template Library (ITL) is a CheckCommand definition that provide such.

    Have a look: https://www.icinga.com/docs/ic…a-template-library/#smart


    Apart from that the apply rule looks good to me. The service even works, but as it tells it cannot open the device /dev/sdh. I suppose that this is caused by the fact that the check call runs with the icinga/nagios user which has not the permission to "look into the device".


    A solution would be to run the specific check as a privileged user e.g. as root. You can do that by using sudo, if you limit the executable command with sudo for the icinga/nagios user this shouldn't be a security problem.


    Hope this helps a bit.

  • Hi,

    no I didn't write it a custom CheckCommand. the service "magically" works now. I didn't touch anything, it just started working after restarting icinga a couple of times. Thanks for the response, and a follow up question: right now the service is written for one disk only. (vars.device = "/dev/sdh") is there a robust way to expand the service to check all available disks without writing it again and again for every single one of them? this server has 60 disks in it, writing DiskChecks one by one is just painful!

    Also, does this plugin work for megaraid devices? check_ide_smart --help doesn't say so! does anyone know a work around?

    Thanks,