How to: integrate check_truenas on Icinga

Hi, yesterday I found this plugin on the net for truenas and I can’t seem to install it properly:

I am not very good at creating non-nrpe services.
I want to create the 4 examples in the README:

  • alerts
  • all zpool health
  • Zpool capacity
  • updates

I am trying to create the first service alerts and at least I have managed to get it to appear on the dashboard but always with some kind of error.


object CheckCommand "truenas" {
         import "plugin-check-command"
         command = [ PluginDir + "/", "-H", "$truenas_host$", "-u", "$truenas_user$", "-p", "$truenas_pass$","-t", "$truenas_type$", "-nv", "-ns" ]

         arguments = {
                 "-H" = "$truenas_host$"
                 "-u" = "$truenas_user$"
                 "-p" = "$truenas_pass$"
                 "-t" = "$truenas_type$"
                 "-pn" = "$truenas_zpoolname$"
                 "-ns" = "$truenas_nossl$"
                 "-nv" = "$truenas_noverifycert$"
                 "-zw" = "$truenas_zpool-warn$"
                 "-zc" = "$truenas_zpool-crit$"
                 "-zp" = "$truenas_perfdata$"

         vars.truenas_host = "$address$"
         vars.truenas_user = "root"
         vars.truenas_type = "alerts"


apply Service "truenas-alerts" {
        import "generic-service"
       assign where match ("coltnas*",
        check_command = "truenas"
        vars.truenas_host = ""
        vars.truenas_pass = "12345"
        vars.sla = "24x7"

Does anyone know what I am doing wrong?


UNKNOWN - request failed - Error when contacting TrueNAS server: (, HTTPError('401 Client Error: Unauthorized for url:'), )


Running it manually as nagios user from satellite works fine:

nagios@coltmon:~$ /usr/lib/nagios/plugins/ -H -u root -p 12345 -t alerts -nv 
OK - No problem alerts

Thank you very much for your help!

wit api works , but with root user not…

         command = [ PluginDir + "/", "-H", "$truenas_host$", "-p", "$truenas_pass$","-t", "$truenas_type$", "-nv", "-ns" ]

Hey @vbits

it helps to see what command icinga executes. Activate the debuglog on the satellite that executes the check or query the API.

curl -k -s -S -i -u username:password t -H 'Accept: application/json' 'https://localhost:5665/v1/objects/services?service=hostname!servicename&attrs=name&attrs=last_check_result&pretty=1'

Replace username, password, hostname and servicename as per your needs.

Kind regards