Problème d' HTML
Fermé
youngIT
Messages postés
7
Date d'inscription
mercredi 26 mai 2021
Statut
Membre
Dernière intervention
26 mai 2021
-
26 mai 2021 à 11:33
jordane45 Messages postés 38424 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 16 février 2025 - 26 mai 2021 à 14:05
jordane45 Messages postés 38424 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 16 février 2025 - 26 mai 2021 à 14:05
A voir également:
- Problème d' HTML
- Editeur html - Télécharger - HTML
- &Nbsp html ✓ - Forum Webmastering
- [HTML] - á et les autres - Forum HTML
- Espace en html - Astuces et Solutions
- Espace html ✓ - Forum Webmastering
5 réponses
youngIT
Messages postés
7
Date d'inscription
mercredi 26 mai 2021
Statut
Membre
Dernière intervention
26 mai 2021
26 mai 2021 à 11:34
26 mai 2021 à 11:34
"pour centreon"
ps: dsl
ps: dsl
jordane45
Messages postés
38424
Date d'inscription
mercredi 22 octobre 2003
Statut
Modérateur
Dernière intervention
16 février 2025
4 734
26 mai 2021 à 11:53
26 mai 2021 à 11:53
Bonjour,
Sans voir le script ..impossible de te répondre ...
( pour poster ton script sur le forum, tu devras utiliser les balises de code : https://codes-sources.commentcamarche.net/faq/11288-les-balises-de-code )
Mais vu le message .. ce script n'est-il pas sensé envoyer un mail ?
Et dans ce cas, il semble que tu n'ais pas précisé de destinataire pour le mail.. d'où le message d'erreur...
Sans voir le script ..impossible de te répondre ...
( pour poster ton script sur le forum, tu devras utiliser les balises de code : https://codes-sources.commentcamarche.net/faq/11288-les-balises-de-code )
Mais vu le message .. ce script n'est-il pas sensé envoyer un mail ?
Et dans ce cas, il semble que tu n'ais pas précisé de destinataire pour le mail.. d'où le message d'erreur...
youngIT
Messages postés
7
Date d'inscription
mercredi 26 mai 2021
Statut
Membre
Dernière intervention
26 mai 2021
26 mai 2021 à 12:26
26 mai 2021 à 12:26
#!/opt/rh/rh-php72/root/usr/bin/php -c /etc/opt/rh/rh-php72/php.ini
<? php
array_shift ( $ argv );
$ f_notify_type = array_shift ( $ argv );
$ f_host_name = array_shift ( $ argv );
$ f_host_alias = array_shift ( $ argv );
$ f_host_state = array_shift ( $ argv );
$ f_host_address = array_shift ( $ argv );
$ f_host_output = array_shift ( $ argv );
$ f_long_date = array_shift ( $ argv );
$ f_serv_desc = array_shift ( $ argv );
$ f_serv_state = array_shift ( $ argv );
$ f_to = array_shift ( $ argv );
$ f_totalup = array_shift ( $ argv );
$ f_totaldown = array_shift ( $ argv );
$ f_ackauthor = array_shift ( $ argv );
$ f_ackcomment = array_shift ( $ argv );
if ( $ f_host_state == " RECOVERY " ) { $ f_color = "#f48400" ;}
if ( $ f_host_state == "DOWN" ) { $ f_color = "#f40000" ;}
if ( $ f_host_state == "UP" ) { $ f_color = "#00b71a" ;}
$ subject = "[CENTREON] $ f_notify_type Host: $ f_host_name" ;
$ url = " " ;
$ from = " " ;
$ body = "<html> <body> <table border = 0 width = '98% 'cellpadding = 0 cellspacing = 0> <tr> <td valign =' top '> \ r \ n" ;
$ body . = "<table border = 0 cellpadding = 0 cellspacing = 0 width = '98% '>" ;
$ body . = "<tr bgcolor = $ f_color> <td width = '140'> <b> <font color = # ffffff> Hôte: </font></b></td> <td> <police color = # ffffff> <b> $ f_notify_type [$ f_host_state] </b> </font> </td> </tr> \ r \ n " ;
if ( $ f_ackauthor ! = "" && $ f_ackcomment ! = "" ) {
$ body . = "<tr bgcolor = $ f_color> <td width = '140'> <b> <font color = # ffffff> $ f_ackauthor: </font> </b> </td> <td> <font color = # ffffff> <b> $ f_ackcomment </b> </font> </td> </tr> \ r \ n " ;
}
$ body . = "<tr bgcolor = # eeeeee> <td> <b> Nom d'hôte: </b></td><td> <b> <a href = '$ url / centreon / main.php? p = 20202 & o = hd & host_name = $ f_host_name '> $ f_host_alias </a> </b></td> </tr> \ r \ n " ;
$ body . = "<tr bgcolor = # fefefe> <td> <b> Adresse: </b></td><td><b>$f_host_address</b></td> </tr> \ r \ n " ;
$ body . = "<tr bgcolor = # eeeeee> <td> <b> Date / Heure: </b></td><td>$f_long_date</td> </tr> \ r \ n" ;
$ body . = "<tr bgcolor = # fefefe> <td> <b> Infos: </b></td> <td> <font color = $ f_color> $ f_host_output </font> </td> </ tr> \ r \ n " ;
$ body . = "<tr bgcolor = # eeeeee> <td> <b> Nombre total d'hôtes en activité: </b></td><td>$f_totalup</td> </tr> \ r \ n" ;
$ body . = "<tr bgcolor = # fefefe> <td> <b> Nombre total d'hôtes en panne: </b></td><td>$f_totaldown</td> </tr> \ r \ n" ;
$ body . = "<tr bgcolor = # eeeeee> <td> <b> Actions: </b></td> <td> <a href = '$ url / centreon / main.php? p = 20201 & o = hd & nom_hôte = $ f_host_name '> <b> Reconnaître </b> </a> </td> </tr> \ r \ n " ;
$ body . = "</table> </table> </body> </html> \ r \ n" ;
$ headers = "De: $ de \ r \ n" ;
$ headers = $ headers . "Type de contenu: texte / html \ r \ n" ;
/ * Envoyer un e-mail maintenant ... * /
mail ( $ f_to , $ subject , $ body , $ headers );
?>
<? php
array_shift ( $ argv );
$ f_notify_type = array_shift ( $ argv );
$ f_host_name = array_shift ( $ argv );
$ f_host_alias = array_shift ( $ argv );
$ f_host_state = array_shift ( $ argv );
$ f_host_address = array_shift ( $ argv );
$ f_host_output = array_shift ( $ argv );
$ f_long_date = array_shift ( $ argv );
$ f_serv_desc = array_shift ( $ argv );
$ f_serv_state = array_shift ( $ argv );
$ f_to = array_shift ( $ argv );
$ f_totalup = array_shift ( $ argv );
$ f_totaldown = array_shift ( $ argv );
$ f_ackauthor = array_shift ( $ argv );
$ f_ackcomment = array_shift ( $ argv );
if ( $ f_host_state == " RECOVERY " ) { $ f_color = "#f48400" ;}
if ( $ f_host_state == "DOWN" ) { $ f_color = "#f40000" ;}
if ( $ f_host_state == "UP" ) { $ f_color = "#00b71a" ;}
$ subject = "[CENTREON] $ f_notify_type Host: $ f_host_name" ;
$ url = " " ;
$ from = " " ;
$ body = "<html> <body> <table border = 0 width = '98% 'cellpadding = 0 cellspacing = 0> <tr> <td valign =' top '> \ r \ n" ;
$ body . = "<table border = 0 cellpadding = 0 cellspacing = 0 width = '98% '>" ;
$ body . = "<tr bgcolor = $ f_color> <td width = '140'> <b> <font color = # ffffff> Hôte: </font></b></td> <td> <police color = # ffffff> <b> $ f_notify_type [$ f_host_state] </b> </font> </td> </tr> \ r \ n " ;
if ( $ f_ackauthor ! = "" && $ f_ackcomment ! = "" ) {
$ body . = "<tr bgcolor = $ f_color> <td width = '140'> <b> <font color = # ffffff> $ f_ackauthor: </font> </b> </td> <td> <font color = # ffffff> <b> $ f_ackcomment </b> </font> </td> </tr> \ r \ n " ;
}
$ body . = "<tr bgcolor = # eeeeee> <td> <b> Nom d'hôte: </b></td><td> <b> <a href = '$ url / centreon / main.php? p = 20202 & o = hd & host_name = $ f_host_name '> $ f_host_alias </a> </b></td> </tr> \ r \ n " ;
$ body . = "<tr bgcolor = # fefefe> <td> <b> Adresse: </b></td><td><b>$f_host_address</b></td> </tr> \ r \ n " ;
$ body . = "<tr bgcolor = # eeeeee> <td> <b> Date / Heure: </b></td><td>$f_long_date</td> </tr> \ r \ n" ;
$ body . = "<tr bgcolor = # fefefe> <td> <b> Infos: </b></td> <td> <font color = $ f_color> $ f_host_output </font> </td> </ tr> \ r \ n " ;
$ body . = "<tr bgcolor = # eeeeee> <td> <b> Nombre total d'hôtes en activité: </b></td><td>$f_totalup</td> </tr> \ r \ n" ;
$ body . = "<tr bgcolor = # fefefe> <td> <b> Nombre total d'hôtes en panne: </b></td><td>$f_totaldown</td> </tr> \ r \ n" ;
$ body . = "<tr bgcolor = # eeeeee> <td> <b> Actions: </b></td> <td> <a href = '$ url / centreon / main.php? p = 20201 & o = hd & nom_hôte = $ f_host_name '> <b> Reconnaître </b> </a> </td> </tr> \ r \ n " ;
$ body . = "</table> </table> </body> </html> \ r \ n" ;
$ headers = "De: $ de \ r \ n" ;
$ headers = $ headers . "Type de contenu: texte / html \ r \ n" ;
/ * Envoyer un e-mail maintenant ... * /
mail ( $ f_to , $ subject , $ body , $ headers );
?>
youngIT
Messages postés
7
Date d'inscription
mercredi 26 mai 2021
Statut
Membre
Dernière intervention
26 mai 2021
26 mai 2021 à 12:27
26 mai 2021 à 12:27
voila dsl c'est un peut long, mais sisi je reçois bien le mais lorsque que j'ai une alerte
jordane45
Messages postés
38424
Date d'inscription
mercredi 22 octobre 2003
Statut
Modérateur
Dernière intervention
16 février 2025
4 734
26 mai 2021 à 12:42
26 mai 2021 à 12:42
Tu n'as pas correctement utiliser les balises de code c'est dommage ça rend le code beaucoup moins lisible...
Quoi qu'il en soit le souci concerne l'utilisation du script en ligne de commande que tu as essayé...
Ce script attends plusieurs paramètres dont le destinataire du mail forcément si tu ne mets pas tous les paramètres lorsque tu lance la ligne de commande à la main tu as une erreur..
Quoi qu'il en soit le souci concerne l'utilisation du script en ligne de commande que tu as essayé...
Ce script attends plusieurs paramètres dont le destinataire du mail forcément si tu ne mets pas tous les paramètres lorsque tu lance la ligne de commande à la main tu as une erreur..
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
youngIT
Messages postés
7
Date d'inscription
mercredi 26 mai 2021
Statut
Membre
Dernière intervention
26 mai 2021
26 mai 2021 à 12:45
26 mai 2021 à 12:45
si tu parle du $url et $from j'ai juste enlevé cela pour éviter des les montrer,
mais sinon merci pour ta réponse .
mais sinon merci pour ta réponse .
jordane45
Messages postés
38424
Date d'inscription
mercredi 22 octobre 2003
Statut
Modérateur
Dernière intervention
16 février 2025
4 734
26 mai 2021 à 14:05
26 mai 2021 à 14:05
Je parle des arguments qui sont à envoyer lorsque tu lances le script...