[perl] Use of uninitialized value
pausg
-
pausg -
pausg -
Bonjour,
Bonjour,
Je débute en perl, et j'essaye d'utiliser un script afin d'obtenir des rapport mensuels de nagios.
J'ai recupéré ce script sur nagiosexchange. Quand je le compile, il me retourne les erreurs:
Use of uninitialized value in print at ./check_reporter line 98.
Can't call method "mail" on an undefined value at ./check_reporter line 318.
La ligne 98 concerne cette partie du code:
$mailbody =~ s@<LINK REL=\'stylesheet\' TYPE=\'text/css\' HREF=\'/stylesheets/common.css\'>@@;
$mailbody =~ s@<LINK REL=\'stylesheet\' TYPE=\'text/css\' HREF=\'/stylesheets/summary.css\'>@$nagsssummary@;
}
open(FILE, "> /tmp/nagios-report-htmlout.html") or warn "can't open file /tmp/nagios-report-htmlout.html: $!\n";
print FILE $mailbody; <----- ligne 98
close FILE;
Et la 2e erreur concerne:
my $mailfrom ='nagios@nagios.com';
$smtp->mail($mailfrom);
Savez vous d'ou peuvent venir ces erreurs et comment les corriger?
Merci d'avance.
Bonjour,
Je débute en perl, et j'essaye d'utiliser un script afin d'obtenir des rapport mensuels de nagios.
J'ai recupéré ce script sur nagiosexchange. Quand je le compile, il me retourne les erreurs:
Use of uninitialized value in print at ./check_reporter line 98.
Can't call method "mail" on an undefined value at ./check_reporter line 318.
La ligne 98 concerne cette partie du code:
$mailbody =~ s@<LINK REL=\'stylesheet\' TYPE=\'text/css\' HREF=\'/stylesheets/common.css\'>@@;
$mailbody =~ s@<LINK REL=\'stylesheet\' TYPE=\'text/css\' HREF=\'/stylesheets/summary.css\'>@$nagsssummary@;
}
open(FILE, "> /tmp/nagios-report-htmlout.html") or warn "can't open file /tmp/nagios-report-htmlout.html: $!\n";
print FILE $mailbody; <----- ligne 98
close FILE;
Et la 2e erreur concerne:
my $mailfrom ='nagios@nagios.com';
$smtp->mail($mailfrom);
Savez vous d'ou peuvent venir ces erreurs et comment les corriger?
Merci d'avance.
A voir également:
- [perl] Use of uninitialized value
- Path of exile 2 - Guide
- Input signal out of range - Forum Ecran
- Cb of london - Forum Vos droits sur internet
- D'sub out of range - Forum Ecran
- Art of illusion - Télécharger - 3D