PDA

View Full Version : check_nt / disques durs / max


L3R4F
04-28-2008, 10:39 AM
Bonjour

J'utilise le plugin check_nt pour récupérer entre autre l'espace utilisé sur les disques durs.
Contrairement au plugin check_centreon_storage, l'espace total du disque dur n'apparait pas, est ce possible d'en afficher la courbe?

Thx

juraj
04-28-2008, 02:05 PM
centreon:/usr/local/nagios/libexec# ./check_nt -H 127.0.0.1 -v USEDDISKSPACE -l c -s None
c:\ - total: 15.77 Gb - utilisé: 12.27 Gb (78%) - libre 3.50 Gb (22%) | 'c:\ Espace Utilisé'=12.27Gb;0.00;0.00;0.00;15.77

Maybe I didn't understand, but the total amount of disk space is there ...

L3R4F
04-28-2008, 04:27 PM
I guess i was still sleeping when i wrote my first post.
My perf data shows me all the data i need, but the problem comes from the graphs.
I only see used disk space and not the total capacity. That makes the graphs pretty useless.

With the check_centreon_snmp_remote_storage plugin, my graph shows me both data, used space and max capacity.

juraj
04-28-2008, 05:01 PM
Hm, supposed that your plugin output correspond slightly to mine, you should have graphed at least the total (absolute) capacity, and the used (absolute) capacity, plus, some critical and warning threshold. Can you confirm you don't have the part of the output past the pipe "|" in the perf data section of service description?

L3R4F
04-28-2008, 05:21 PM
Here is what Centreon gives me:
Information sur le status c:\ - total: 3.91 Gb - used: 2.04 Gb (52%) - free 1.87 Gb (48%)
Données de Performance 'c:\ Used Space'=2.04Gb;3.13;3.52;0.00;3.91

I use this command:
$USER1$/check_nt -H $HOSTADDRESS$ -v USEDDISKSPACE -s xx -p xx -l C -w 80 -c 90

And the graph:
http://forum.centreon.com/attachment.php?attachmentid=742&stc=1&d=1209392210

The plugin check_centreon_snmp_remote_storage looks like this:
http://forum.centreon.com/attachment.php?attachmentid=743&stc=1&d=1209392384

juraj
04-28-2008, 05:38 PM
Ok, I see. It seems check_nt outputs only one data value in the performance section. But a quick'n'easy fix by wrapping the check_nt into something that would output proper performance part, even including the total disk space, shouldn't be too tedious to create?

L3R4F
04-28-2008, 05:44 PM
You mean by calling the check_nt command with a kind of script wich could give me a nice output like the one with check_centreon_snmp_remote_storage?

juraj
04-28-2008, 05:45 PM
Exactly. (So the minimum length of the message to post is ten characters? Funny :-) )

L3R4F
04-29-2008, 11:12 AM
Thanks for your help juraj.
Maybe someone already made this script, i gonna seek for some infos :)

L3R4F
04-29-2008, 05:59 PM
#!/bin/bash
result=$(/usr/local/nagios/libexec/check_nt -H $1 -v USEDDISKSPACE -l c -w 90 -c 95 -s pouet -p 12489)
info_status=$( echo $result | cut -d '|' -f 1)
perf_data=$( echo $result | cut -d '|' -f 2)
total=$( echo $perf_data | cut -d ';' -f 5)

echo $info_status '|' "'"'Espace Total='$total Gb"'" $perf_data


Pretty ugly isn't it :confused:

Results here:
nagios:/usr/local/nagios/libexec# ./check_nt_disk 127.0.0.1
c:\ - total: 74,46 Gb - utilisé: 13,01 Gb (17%) - libre 61,44 Gb (83%) | 'Espace Total=74,46 Gb' 'c:\ Espace Utilisé'=13,01Gb;67,01;70,74;0.00;74,46


Used and Total are inverted on the graph :s

juraj
04-29-2008, 06:27 PM
check the service-perfdata file whether nagios parses the data correctly. As you correctly assumed, it's not really beautiful :-D.
A word of advice: save the return code via $?. Now you won't be getting any alerts, since your script always returns 0 .....