Check AND metric for disk usage

Hi guys.

I’m trying to use a check that also sends disk usage metrics (disk free, disk used) to Graphite.

Here’s what I’ve configured:

  • Plugin (taken from nagios exchange):

/sensu/plugins//etc/sensu/plugins/check_linux_stats.pl

  • Check definition:

/sensu/conf.d/check_diskusage.json

{

"checks": {

    "check_diskusage": {

       "handlers": [ "graphite" ],

        "command": "/etc/sensu/plugins/[check_linux_stats.pl](http://check_linux_stats.pl) -D -w 80 -c 90",

        "interval": 60,

        "occurrences": 5,

        "refresh": 1800,

        "flapping": true,

        "subscribers": [ "server-01" ]

    }

}

}

  • Handler definition:

/sensu/conf.d/handler_graphite.json

{

“handlers”: {

"graphite": {

  "type": "amqp",

  "exchange": {

    "type": "topic",

    "name": "metrics",

    "durable": "true"

  },

  "mutator": "only_check_output", "nagios_perfdata"

}

}

}

  • Mutator:

/sensu/conf.d/mutator_nagios_perfdata.json

{

“mutators”: {

“nagios_perfdata”: {

“command”: “/etc/sensu/mutators/nagios_perfdata.rb”

}

}

  • Extensions:

/sensu/mutators/nagios_perfdata.rb

Now, here’s the output:

DISK OK used : /dev/shm 100.00% free /opt 34.46% free / 33.80% free | /dev/shm=0MB /opt=24960680MB /=5382244MB

The perfdata is correctly written but I don’t get any data in Graphite.

Is there anything I’m not doing right??

Thanks!!

···


Mariano Gabriel González