[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
- Intitle index of ✓ - Forum Téléchargement
- Departure from inward office of exchange - Forum Réseaux sociaux
- Out of range - Forum Ecran
- Paiement cb of london c'est quoi - Forum Consommation & Internet