コード例 #1
0
function compare_1550($t1, $t2, $t3, $t4, $r, $time, $ip, $mac, $comments)
{
    if ($t1 != "" && $t2 != "" && $t3 != "" && $t4 != "") {
        if ($t1 <= $t2 && $t2 <= $t3 && $t3 <= $t4) {
            if ($r > floatval($t4)) {
                $log = "EG1550 has a high-high alarm! (" . $comments . " : " . $r . ")";
                alarmLogger($time, $ip, $mac, $log, "high-high");
            }
            if ($r < floatval($t4) && $r > floatval($t3)) {
                $log = "EG1550 has a high alarm! (" . $comments . " : " . $r . ")";
                alarmLogger($time, $ip, $mac, $log, "high");
            }
            if ($r < floatval($t2) && $r > floatval($t1)) {
                $log = "EG1550 has a low alarm! (" . $comments . " : " . $r . ")";
                alarmLogger($time, $ip, $mac, $log, "low");
            }
            if ($r < floatval($t1)) {
                $log = "EG1550 has a low-low alarm! (" . $comments . " : " . $r . ")";
                alarmLogger($time, $ip, $mac, $log, "low-low");
            }
        }
    }
}
コード例 #2
0
function checkFanStatus($fan, $time, $ip)
{
    $mac = "";
    // cuz mac is not available from here
    if ($fan != 1) {
        $log = "ELink HeadEnd has malfunctional fan.";
        alarmLogger($time, $ip, $mac, $log, "fan out");
    }
}