remove strict comparisons for check-services.php (#8992)

Required by #8935

That PR returns ints if appropriate
"0" => 0
This commit is contained in:
Tony Murray 2018-08-06 20:29:06 -05:00 committed by GitHub
parent 877cab5dce
commit 8480fdf7de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -63,13 +63,13 @@ $sql = 'SELECT D.*,S.*,attrib_value FROM `devices` AS D'
foreach (dbFetchRows($sql) as $service) {
// Run the polling function if the associated device is up, "Disable ICMP Test" option is not enabled,
// or service hostname/ip is different from associated device
if ($service['status'] === "1" || ($service['status'] === '0' && $service['status_reason'] === 'snmp') ||
if ($service['status'] == 1 || ($service['status'] == 0 && $service['status_reason'] === 'snmp') ||
$service['attrib_value'] === 'true' || ($service['service_ip'] !== $service['hostname'] &&
$service['service_ip'] !== inet6_ntop($service['ip']) )) {
// Mark service check as enabled if it was disabled previously because device was down
if ($service['service_disabled'] === "1") {
if ($service['service_disabled']) {
dbUpdate(
array('service_disabled' => '0'),
array('service_disabled' => 0),
'services',
'`service_id` = ?',
array($service['service_id'])
@ -82,9 +82,9 @@ foreach (dbFetchRows($sql) as $service) {
.$service['hostname']." is down due to icmp.\n");
// Mark service check as disabled while device is down and log to eventlog that service check is skipped,
// but only if it's not already marked as disabled
if ($service['service_disabled'] === "0") {
if (!$service['service_disabled']) {
dbUpdate(
array('service_disabled' => '1'),
array('service_disabled' => 1),
'services',
'`service_id` = ?',
array($service['service_id'])