View Full Version : Problème avec check_graph_snmp_value
Bonjour à tous,
Lorsque que j'exécute certain plugins j'ai des erreurs, par exemple avec le plugin suivant :
check_graph_snmp_value.pl
./check_graph_snmp_value.pl -H 192.168.0.18 -C public -w 95 -c 100 -S 45 -g
ERREUR :
Undefined subroutine &main::get_parameters called at ./check_graph_snmp_value.pl line 33
j'ai donc modifier la ligne 33 et j'ai mis oreon::get_parameters la ça passe, mais j'ai une autre erreur
Undefined subroutine &main::is_valid_serviceid called at ./check_graph_snmp_value.pl line 78.
j'ai tenté de mettre le oreon devant is_valid_serviceid mais ça ne fonctionne pas
Que faire ?
j'ai Oreon 1.2.2 / Nagios 1.2
Merci
il manquerai pas l'option -o ??? :roll:
Si exact, c'est une erreur de copier/coller
voila la bonne commande mais le problème reste le même
./check_graph_snmp_value.pl -H 192.168.0.18 -C public -o 1.3.6.1.2.1.25.3.3.1.2.2 -w 95 -c 100 -S 45 -g
julio
05-23-2006, 12:21 PM
oauis c clair sinon je me demande ce qu'il fait le plugin si on lui file pas d'OID :d
./check_graph_snmp_value.pl -H 192.168.0.18 -C public -o 1.3.6.1.2.1.25.3.3.1.2.2 -w 95 -c 100 -S 45 -g
ta ligne me semble valide faudrai peu etre rajouer l'option -v
version de ton snmp
je viens de tester ta ligne elle marche chez moi
j'obtiens
Ok value : 3
en ce qui concerne tes warnings verifie que tu as bien un fichier oreon.pm
dans le repertoire de tes plugins
:) [/quote]
J'ai bien le fichier oreon.pm dans mon répertoire des plugind
voici le contenu de ce fichier
# $Id: oreon.pm,v 1.3 2005/08/11 11:38:41 wistof Exp $
#
# Oreon's plugins are developped with GPL Licence :
# http://www.fsf.org/licenses/gpl.txt
# Developped by : Mathieu Chateau - Christophe Coraboeuf
#
#
# The Software is provided to you AS IS and WITH ALL FAULTS.
# OREON makes no representation and gives no warranty whatsoever,
# whether express or implied, and without limitation, with regard to the quality,
# safety, contents, performance, merchantability, non-infringement or suitability for
# any particular or intended purpose of the Software found on the OREON web site.
# In no event will OREON be liable for any direct, indirect, punitive, special,
# incidental or consequential damages however they may arise and even if OREON has
# been previously advised of the possibility of such damages.
package oreon;
use FindBin qw($Bin);
use lib "$Bin";
my $params_file="oreon.conf";
sub get_parameters
{
my %oreon;
my @splitter;
my $buffer="";
my $i=0;
my @file;
$params_file = "$Bin/$params_file";
unless (-e $params_file)
{
print "Unknown - In oreon.pm :: $params_file :: $!\n";
exit $ERRORS{'UNKNOWN'};
}
unless (open(PARAMS, $params_file))
{
print "Unknown - In oreon.pm :: $!\n";
exit $ERRORS{'UNKNOWN'};
}
@file=<PARAMS>;
foreach (@file)
{
$buffer="";
if (! /^[\s, #]/)
{
chomp($_);
@splitter=split('=',$_);
for ($i=1;$i<=$#splitter;$i++)
{
$buffer.=$splitter[$i]."=";
}
chop($buffer);
$oreon{$splitter[0]}=$buffer;
}
}
close(PARAMS);
return %oreon;
}
1;
il manque pas mal de chose dans ton fichier oreon.pm
les fonctions concernant les rrds et
cette fonction :
sub is_valid_serviceid {
my $ServiceId = shift;
if ($ServiceId && $ServiceId =~ m/^([0-9_]+)$/) {
return $ServiceId;
}else{
print "Unknown -S Service ID expected... or it doesn't exist, try another id - number\n";
exit $ERRORS{'UNKNOWN'};
}
}
:wink:
au final la solution change ton fichier oreon.pm 8)
3eme edit :
le probleme est que tu as une version d'oreon ancienne 1.2.2
et tu essaie de mettre un plugins qui a ete fait pour la version 1.3
utilisant le rrdtool
d'ou le probleme avec le fichier oreon.pm
:roll:
ok je comprends le problème, est il possible de mettre à jour la 1.2.2 vers la 1.2.3 RC4 sans perdre toutes mes infos et mes sondes ?
je pense que je vais faire la migration