This commit is contained in:
JonatanRek 2024-08-16 18:23:04 +02:00
parent 2f4f917032
commit f3a3dcb566

View File

@ -19,9 +19,11 @@ public function sync()
$zabbix->connect("spaninger", "*");
foreach ( $zabbix->maintenances([ "selectTimeperiods" => "extend" ]) as $maintennace ) {
if(!Carbon::createFromTimestamp($maintennace['active_till'])->isPast()){
dd(Carbon::createFromTimestamp($maintennace['active_till']));
if(Carbon::createFromTimestamp($maintennace['active_till'])->isPast()){
continue;
}
dd(Carbon::createFromTimestamp($maintennace['active_till']));
}
foreach ($zabbix->hosts() as $host) {
@ -31,6 +33,7 @@ public function sync()
"display_name" => $host['name'],
]);
}
return redirect()->back();
}
}