In setup.php and functions.php, find the lines with:
Code: Select all
" where message like '
Code: Select all
" where " . $haloe_config["textField"] . " like '
Moderators: Developers, Moderators
Code: Select all
" where message like '
Code: Select all
" where " . $haloe_config["textField"] . " like '
mgb wrote:@nahun,
I had the same problem as you didbut after changing msg to message and changing PSOT to POST the faultmessage from the cacti log disapeared and the remove seems to work.ERROR: SQL Assoc Failed
Sounds good, I'll try it as soon as I get some time at work. To many projects at oncetgk wrote:I think I have a fix for the msg/message column.
You can actually just do this yourself by editing the haloe.php file. Where this part starts around line 296 on mine at least:twelzy wrote: Is there any possibility to put a line between each event?
Code: Select all
<td nowrap valign=top>
<?php print $haloe_message[$haloe_config["hostField"]];?>
</td>
<td nowrap valign=top>
<?php print "";?>
</td>
<td nowrap valign=top>
<?php print $haloe_message[$haloe_config["dateField"]];?>
</td>
<td nowrap valign=top>
<?php print $haloe_message[$haloe_config["timeField"]];?>
</td>
<td nowrap>
<?php print "";?>
</td>
<td valign=top>
<?php print $haloe_message[$haloe_config["textField"]];?>
</td>
<td nowrap valign=top>
<?php print $haloe_message[$haloe_config["priorityField"]];?>
</td>
<td nowrap valign=top>
<center><a href='haloe_remove.php?id=<?php print $haloe_message[$haloe_config["id"]]; ?>#edit'><img src='images/red.gif' border=0></a> <a href='haloe_alert.php?id=<?php print $haloe_message[$haloe_config["id"]]; ?>#edit'><img src='images/green.gif' border=0></a></center>
</td>
Code: Select all
<td nowrap valign=top style="border-bottom:1px solid #000000">
<?php print $haloe_message[$haloe_config["hostField"]];?>
</td>
<td nowrap valign=top style="border-bottom:1px solid #000000">
<?php print " ";?>
</td>
<td nowrap valign=top style="border-bottom:1px solid #000000">
<?php print $haloe_message[$haloe_config["dateField"]];?>
</td>
<td nowrap valign=top style="border-bottom:1px solid #000000">
<?php print $haloe_message[$haloe_config["timeField"]];?>
</td>
<td nowrap style="border-bottom:1px solid #000000">
<?php print " ";?>
</td>
<td valign=top style="border-bottom:1px solid #000000">
<?php print $haloe_message[$haloe_config["textField"]];?>
</td>
<td nowrap valign=top style="border-bottom:1px solid #000000">
<?php print $haloe_message[$haloe_config["priorityField"]];?>
</td>
<td nowrap valign=top style="border-bottom:1px solid #000000">
<center><a href='haloe_remove.php?id=<?php print $haloe_message[$haloe_config["id"]]; ?>#edit'><img src='images/red.gif' border=0></a> <a href='haloe_alert.php?id=<?php print $haloe_message[$haloe_config["id"]]; ?>#edit'><img src='images/green.gif' border=0></a></center>
</td>
Code: Select all
style="border-bottom:1px solid"
Code: Select all
/* SEND OUT ALERTS ON THINGS WE SPECIFY */
$alertarray = db_fetch_assoc("SELECT * FROM " . $haloe_config["alertTable"]);
foreach ($alertarray as $alert) {
$sql = '';
$alertm = '';
if ($alert['type'] == 'messageb') {
$sql = 'select * from ' . $haloe_config["incomingTable"] . " where " . $haloe_config["textField"] . " like '" . $alert['message'] . "%' and status=1";
}
if ($alert['type'] == 'messagec') {
$sql = 'select * from ' . $haloe_config["incomingTable"] . " where " . $haloe_config["textField"] . " like '%" . $alert['message'] . "%' and status=1";
}
if ($alert['type'] == 'messagee') {
$sql = 'select * from ' . $haloe_config["incomingTable"] . " where " . $haloe_config["textField"] . " like '%" . $alert['message'] . "' and status=1";
}
Code: Select all
if ($alert['type'] == 'host')
Code: Select all
/* SEND OUT ALERTS ON THINGS WE SPECIFY */
$alertarray = db_fetch_assoc("SELECT * FROM " . $haloe_config["alertTable"]);
foreach ($alertarray as $alert) {
$sql = '';
$alertm = '';
Code: Select all
if ($alert['type'] == 'host') {
$sql = 'select * from ' . $haloe_config["incomingTable"] . " where " . $haloe_config["hostField"] . "='" . $alert['msg'] . "' and status=1";
}
Code: Select all
$alert['message']
Code: Select all
$alert['msg']
Code: Select all
$alertm .= "<table cellpadding=1 cellspacing=0 border=0 bgcolor='#000000' width=500><tr><td><table width='100%' cellpadding=1 cellspacing=0 border=0 bgcolor='#FFFFFF'>\n";
$alertm .= '<tr bgcolor="#dedede"><td>Hostname</td><td>: ' . $a['host'] . "</td></tr>\n";
$alertm .= '<tr bgcolor="#dedede"><td>Date</td><td>: ' . $a['date'] . ' ' . $a['time'] . "</td></tr>\n";
$alertm .= '<tr bgcolor="#dedede"><td>Severity</td><td>: ' . $a['priority'] . "</td></tr>\n";
$alertm .= '<tr bgcolor="#000000"><td colspan=2 height=1>' . "</td></tr>\n";
$alertm .= '<tr><td colspan=2>' . $a['message'] . "\n</td></tr>";
$alertm .= "</table></td></tr></table><br><br>\n";
Code: Select all
$alertm .= "<table cellpadding=1 cellspacing=0 border=0 bgcolor='#000000' width=500><tr><td><table width='100%' cellpadding=1 cellspacing=0 border=0 bgcolor='#FFFFFF'>\n";
$alertm .= '<tr bgcolor="#dedede"><td>Hostname</td><td>: ' . $a['host'] . "</td></tr>\n";
$alertm .= '<tr bgcolor="#dedede"><td>Date</td><td>: ' . $a['date'] . ' ' . $a['time'] . "</td></tr>\n";
$alertm .= '<tr bgcolor="#dedede"><td>Severity</td><td>: ' . $a['priority'] . "</td></tr>\n";
$alertm .= '<tr bgcolor="#dedede"><td>Message</td><td>: ' . $a['msg'] . "</td></tr>\n";
$alertm .= '<tr bgcolor="#000000"><td colspan=2 height=1>' . "</td></tr>\n";
$alertm .= '<tr><td colspan=2>' . $a['message'] . "\n</td></tr>";
$alertm .= "</table></td></tr></table><br><br>\n";
All of mine are status=0 too, and I couldn't find where it would change that, but alerts are working for me. So I'm not quite sure. I'll check some more.kingaru wrote:Soo.. if I'm correct the setup.php should select records for alarm which have "status=1" ... I just checked my database and all records in my syslog_incoming database have status=0 ... where and how this status is changing? Why it is always stays 0?
The syslogs are moved from the syslog_incoming table to the syslog table every time cacti does its polling. So unless you have it set to once an hour, I don't know. You can check to see if the syslogs are getting inserted into the syslog_incoming table right away and if they just sit there for a long time.Amag wrote:The question:
1) Is Cacti only polling its syslogd to post to Cacti every x amount of minutes? If so, what is this timeframe and how do we change it?
2) If not, can someone give me any suggestions to troubleshoot?
Could you post the column structure of the syslog and syslog_incoming tables? Specifically looking for the msg column, it might be message. You have to change some code in haloe to get it to work with msg. Check some of the posts at the beginning of this page.klr0514 wrote: I still never see the output in my syslogs page...
Users browsing this forum: No registered users and 0 guests