コード例 #1
0
                                }
                            }
                        } else {
                            /* get a list of hosts impacted */
                            $hostlist[] = $a['host'];
                        }
                        if (trim($alert['command']) != '' && !$ignore) {
                            $command = alert_replace_variables($alert, $a);
                            cacti_log("SYSLOG NOTICE: Executing '{$command}'", true, 'SYSTEM');
                            exec_background('/bin/sh', $command);
                        }
                    }
                    $htmlm .= '</table></body></html>';
                    $alertm .= "-----------------------------------------------\n\n";
                    if ($alert['method'] == 1) {
                        $sequence = syslog_log_alert($alert['id'], $alert['name'], $alert['severity'], $at[0], sizeof($at), $htmlm, $hostlist);
                        $smsalert = 'Sev:' . $severities[$alert['severity']] . ', Count:' . sizeof($at) . ', URL:' . read_config_option('alert_base_url') . 'plugins/syslog/syslog.php?tab=current&id=' . $sequence;
                    }
                    syslog_debug("Alert Rule '" . $alert['name'] . "' has been activated");
                }
            }
        }
        if ($alertm != '' && $alert['method'] == 1) {
            $resend = true;
            if ($alert['repeat_alert'] > 0) {
                $found = syslog_db_fetch_cell('SELECT count(*)
					FROM syslog_logs
					WHERE alert_id=' . $alert['id'] . "\n\t\t\t\t\tAND logtime>'{$date}'");
                if ($found) {
                    $resend = false;
                }
コード例 #2
0
                         }
                     }
                 } else {
                     /* get a list of hosts impacted */
                     $hostlist[] = $a['host'];
                 }
                 if (trim($alert['command']) != "" && !$ignore) {
                     $command = alert_replace_variables($alert, $a);
                     cacti_log("SYSLOG NOTICE: Executing '{$command}'", true, "SYSTEM");
                     exec_background("/bin/sh", $command);
                 }
             }
             $htmlm .= "</table></body></html>";
             $alertm .= "-----------------------------------------------\n\n";
             if ($alert["method"] == 1) {
                 $sequence = syslog_log_alert($alert["id"], $alert["name"] . " [" . $alert["message"] . "]", $alert["severity"], $at[0], sizeof($at), $htmlm);
                 $smsalert = "Sev:" . $severities[$alert["severity"]] . ", Count:" . sizeof($at) . ", URL:" . read_config_option("alert_base_url") . "plugins/syslog/syslog.php?tab=current&id=" . $sequence;
             }
             syslog_debug("Alert Rule '" . $alert['name'] . "' has been activated");
         }
     }
 }
 if ($alertm != '' && $alert['method'] == 1) {
     $resend = true;
     if ($alert['repeat_alert'] > 0) {
         $found = syslog_db_fetch_cell("SELECT count(*)\n\t\t\t\t\tFROM syslog_logs\n\t\t\t\t\tWHERE alert_id=" . $alert['id'] . "\n\t\t\t\t\tAND logtime>'{$date}'");
         if ($found) {
             $resend = false;
         }
     }
     if ($resend) {