Description to eventlog thold (SOLVED)
Moderators: Developers, Moderators
Description to eventlog thold (SOLVED)
hi all my event log is saying "Cacti[4120]CMDPHP: Host[25] ERROR: HOST EVENT: Host is DOWN Message: Host did not respond to SNMP" when a host goes Down is there any way to make it log the Description of the devices, im sadly not the biggest PHP.
Last edited by Tomic on Thu Feb 27, 2014 5:47 am, edited 1 time in total.
Re: Description to eventlog thold
I found a solution on the forum:
anuraganuj wrote:modify following ini functions.php
if ($issue_log_message) {
if ($hosts[$host_id]["status"] == HOST_DOWN) {
cacti_log("Host[$host_id :: $ip] ERROR: HOST EVENT: Host is DOWN Message: " . $hosts[$host_id]["status_last_error"], $print_data_to_stdout);
} else {
cacti_log("Host[$host_id] NOTICE: HOST EVENT: Host Returned from DOWN State: ", $print_data_to_stdout);
}
}
to
$sql = "SELECT hostname,description from host where id=$host_id";
$result = mysql_query($sql);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$name = $row['description'];
$ip = $row['hostname'];
/* if there is supposed to be an event generated, do it */
if ($issue_log_message) {
if ($hosts[$host_id]["status"] == HOST_DOWN) {
cacti_log("Host[$name :: $ip] ERROR: HOST EVENT: Host is DOWN Message: " . $hosts[$host_id]["status_last_error"], $print_data_to_stdout);
} else {
cacti_log("Host[$host_id] NOTICE: HOST EVENT: Host Returned from DOWN State: ", $print_data_to_stdout);
}
}
Who is online
Users browsing this forum: No registered users and 0 guests