Someone can help me.
Warning: in_array() expects parameter 2 to be array, null given in /usr/local/nagiosxi/html/admin/missingobjects.php on line 279
//refactor services array to handle hidden (deleted) items from the list
$show_svcs = array();
foreach($svcs as $sn => $val) {
if(in_array($sn,$hidden))
continue;
$show_svcs[$sn] = $val;
}
Code: Select all
$current_host=0;
$displayed=0;
foreach($newobjects as $hn => $arr){
//skip hidden (deleted) hosts
if(grab_array_var($arr,'hide_all',false)==true)
continue;
$svcs=$arr["services"];
$hidden = grab_array_var($arr,'hidden_services',array());
$total_services=0;
//refactor services array to handle hidden (deleted) items from the list
$show_svcs = array();
foreach($svcs as $sn => $val) {
if(in_array($sn,$hidden))
continue;
$show_svcs[$sn] = $val;
}
//overwrite old array
$svcs = $show_svcs;
$total_services=count($svcs);
// skip if host/service already exists
if($total_services==0 && host_exists($hn)==true)
continue;
else if($total_services>0){
$missing=0;
foreach($svcs as $sn => $sarr){
if(service_exists($hn,$sn)==true || in_array($sn,$hidden) ) //hide deleted services
continue;
$missing++;
}
if($missing==0)
continue;
}