hello
you are using a 7 years old php script you have modified, could you please check the syntax of the php you changed is still working with the current php version you use on your new centreon 21? (there has been some major change in php since centreon 2 and centreon 21, like php5 to 7 or 8)
the original script don’t use “CC”, only “TO” , so the part you modified is probably the root of your problem and without the code you modified it’s not easy to debug
(I know I had some array manipulation issues between php versions, there are warnings on the output console when you run in shell the script)
(try debugging the script and add output on your server, copy it, add some console prints and check if you have warnings and comment the send mail at the end, you can run it manually without all the informations for debugging, just run it with fake value)
@christophe.niel-ACT
Thanks for the response, I already figured it out and it working fine now.
Hi @kimpoy0730, feel free to share the solution with the whole community, so that those who may have the same problem can also benefit from it : ) Thanks in advance
Before
$f_serviceurlb =str_replace("+","",$f_serviceurla);
$f_serviceurlc =str_replace("%40","@",$f_serviceurlb);
$f_serviceurld =str_replace("%2526","&",$f_serviceurlc);
$str_explode=explode("%2C",$f_serviceurld);
$servicecc1 = $str_explodee0];
$servicecc2 = $str_explodee1];
$servicecc3 = $str_explodee2];
$servicecc4 = $str_explodee3];
$servicecc5 = $str_explodee4];
$f_hosturlb =str_replace("+","",$f_hosturla);
$f_hosturlc =str_replace("%40","@",$f_hosturlb);
$f_hosturld =str_replace("%2526","&",$f_hosturlc);
$str_explode=explode("%2C",$f_hosturld);
$hostcc1 = $str_explodee0];
$hostcc2 = $str_explodee1];
$hostcc3 = $str_explodee2];
$hostcc4 = $str_explodee3];
$hostcc5 = $str_explodee4];
After
$f_serviceurlb =str_replace("+","",$f_serviceurla);
$f_serviceurlc =str_replace("%40","@",$f_serviceurlb);
$f_serviceurld =str_replace("%2526","&",$f_serviceurlc);
$str_explode=explode(", ",$f_serviceurld);
$servicecc1 = $str_explodee0];
$servicecc2 = $str_explodee1];
$servicecc3 = $str_explodee2];
$servicecc4 = $str_explodee3];
$servicecc5 = $str_explodee4];
$f_hosturlb =str_replace("+","",$f_hosturla);
$f_hosturlc =str_replace("%40","@",$f_hosturlb);
$f_hosturld =str_replace("%2526","&",$f_hosturlc);
$str_explode=explode(", ",$f_hosturld);
$hostcc1 = $str_explodee0];
$hostcc2 = $str_explodee1];
$hostcc3 = $str_explodee2];
$hostcc4 = $str_explodee3];
$hostcc5 = $str_explodee4];
We just changed the $str_explode=explode part from “%2C” to “, “ to fix the issue.