change metric name in meta service (OMS => value)

git-svn-id: http://svn.centreon.com/trunk/plugins-2.x@6892 6bcd3966-0018-0410-8128-fd23d134de7e
This commit is contained in:
Julien Mathis 2008-10-23 20:25:39 +00:00
parent 5ad10be9a6
commit 33564078e7
1 changed files with 15 additions and 15 deletions

View File

@ -82,59 +82,59 @@ sub return_value($$$$){
if ($warning < $critical){ # Bon sens
if ($result < $warning){
if ($output) {
print $output. "|OMS=" . $result . ";".$warning.";".$critical."\n";
print $output. "|value=" . $result . ";".$warning.";".$critical."\n";
}else {
print "OK result : " . $result . "|OMS=" . $result . ";".$warning.";".$critical."\n";
print "OK result : " . $result . "|value=" . $result . ";".$warning.";".$critical."\n";
}
exit $ERRORS{'OK'};
} elsif (($result >= $warning) && ($result < $critical)){
if ($output) {
print $output. "|OMS=" . $result . ";".$warning.";".$critical."\n";
print $output. "|value=" . $result . ";".$warning.";".$critical."\n";
}else {
print "WARNING result : " . $result . "|OMS=" . $result . ";".$warning.";".$critical."\n";
print "WARNING result : " . $result . "|value=" . $result . ";".$warning.";".$critical."\n";
}
exit $ERRORS{'WARNING'};
} elsif ($result >= $critical){
if ($output) {
print $output. "|OMS=" . $result . ";".$warning.";".$critical."\n";
print $output. "|value=" . $result . ";".$warning.";".$critical."\n";
}else {
print "CRITICAL result : " . $result . "|OMS=" . $result . ";".$warning.";".$critical."\n";
print "CRITICAL result : " . $result . "|value=" . $result . ";".$warning.";".$critical."\n";
}
exit $ERRORS{'CRITICAL'};
}
} else { # sens inverse
if ($result < $critical){
if ($output) {
print $output. "|OMS=" . $result . ";".$warning.";".$critical."\n";
print $output. "|value=" . $result . ";".$warning.";".$critical."\n";
}else {
print "CRITICAL result : " . $result . "|OMS=" . $result . ";".$warning.";".$critical."\n";
print "CRITICAL result : " . $result . "|value=" . $result . ";".$warning.";".$critical."\n";
}
exit $ERRORS{'CRITICAL'};
} elsif ($result >= $critical && $result < $warning){
if ($output) {
print $output. "|OMS=" . $result . ";".$warning.";".$critical."\n";
print $output. "|value=" . $result . ";".$warning.";".$critical."\n";
}else {
print "WARNING result : " . $result . "|OMS=" . $result . ";".$warning.";".$critical."\n";
print "WARNING result : " . $result . "|value=" . $result . ";".$warning.";".$critical."\n";
}
exit $ERRORS{'WARNING'};
} elsif ($result >= $warning){
if ($output) {
print $output. "|OMS=" . $result . ";".$warning.";".$critical."\n";
print $output. "|value=" . $result . ";".$warning.";".$critical."\n";
}else {
print "OK result : " . $result . "|OMS=" . $result . ";".$warning.";".$critical."\n";
print "OK result : " . $result . "|value=" . $result . ";".$warning.";".$critical."\n";
}
exit $ERRORS{'OK'};
} else{
if ($output) {
print $output. "|OMS=" . $result . ";".$warning.";".$critical."\n";
print $output. "|value=" . $result . ";".$warning.";".$critical."\n";
}else {
print "OK result : " . $result . "|OMS=" . $result . ";".$warning.";".$critical."\n";
print "OK result : " . $result . "|value=" . $result . ";".$warning.";".$critical."\n";
}
exit $ERRORS{'OK'};
}
}
} elsif (!defined($warning) || !defined($critical)) {
print "Result : " . $result . "|OMS=" . $result . "\n";
print "Result : " . $result . "|value=" . $result . "\n";
exit $ERRORS{'OK'};
} else {
print "ERROR : warnig level = critical level";