Syslog monitor addon beta

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
klr0514
Posts: 27
Joined: Tue Apr 04, 2006 8:19 am
Contact:

Post by klr0514 »

I am building another system (a little beefier now) using linux... All of my plugins are working except haloe.php... When I click on the syslogs tab, it attempts to open haloe.php as a text file. Everything else (threshold, weathermap, discovery, monitor) are working fine, just haloe... Oddly enough I have this working on my other setup using haloe version 0.2... Any ideas?

I have also tried to remove the entire haloe directory and re-add the plugin, but I am still getting the same result.
cigamit
Developer
Posts: 3363
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

klr0514 wrote:I am building another system (a little beefier now) using linux... All of my plugins are working except haloe.php... When I click on the syslogs tab, it attempts to open haloe.php as a text file. Everything else (threshold, weathermap, discovery, monitor) are working fine, just haloe... Oddly enough I have this working on my other setup using haloe version 0.2... Any ideas?

I have also tried to remove the entire haloe directory and re-add the plugin, but I am still getting the same result.
Usually a problem with PHP (wierd that everything else works thought) or a permissions problem.
klr0514
Posts: 27
Joined: Tue Apr 04, 2006 8:19 am
Contact:

Post by klr0514 »

Permissions match all of the other plugins, and they are working.... I noticed a major reduction in size and content in setup.php from version 0.2... Any chance something in here could be the problem? I am using PHP 5.1.4.
User avatar
nahun
Cacti User
Posts: 92
Joined: Wed Feb 15, 2006 11:27 pm
Location: Idaho
Contact:

Post by nahun »

klr0514 wrote:When I click on the syslogs tab, it attempts to open haloe.php as a text file.
I think I know what you're talking about and I've had the same problem. I've had it where firefox tries to get me to download haloe.php when I click the syslog tab and IE just won't open the page. Nothing to do with a text file, but maybe it is a similar problem.

My problem was my config.php in haloe. The parameters for the $haloe_config array was wrong. Mainly the "haloeTable" was pointed to the wrong table and I think the "Fields" were wrong too. Could you post your config.php and what your syslog mysql tables look like?
[size=75]Solaris 10 x86 [color=red][b]||[/b][/color] Cacti - 0.8.7 [color=red][b]||[/b][/color] MySQL - 5.0.45 [color=red][b]||[/b][/color] PHP - 5.2.6 [color=red][b]||[/b][/color] RRDTool - 1.2.23 [color=red][b]||[/b][/color] NET-SNMP - 5.4.1 [color=red][b]||[/b][/color] Syslog-ng 2.0.5
[url=http://www.indigo-networks.com]indigo-networks.com[/url][/size]
klr0514
Posts: 27
Joined: Tue Apr 04, 2006 8:19 am
Contact:

Post by klr0514 »

Here is my config.php from haloe...

<?php

$haloedb_type = "mysql";
$haloedb_default = "haloe";
$haloedb_hostname = "localhost";
$haloedb_username = "xxxxxx";
$haloedb_password = "xxxxxx";

$haloe_config["rows_per_page"] = "30";

// Integrate with Graph View Timespan Selector. If false, keep seperate timespan settings
$haloe_config["graphtime"] = true;

// Display timespan selector or not [ only used if $haloe_config["graphtime"]=false ]
$haloe_config["timespan_sel"] = true;

// Field Mappings, adjust to match the haloe table columns in use
$haloe_config["haloeTable"] = "syslog";
$haloe_config["incomingTable"] = "syslog_incoming";
$haloe_config["removeTable"] = "syslog_remove";
$haloe_config["alertTable"] = "syslog_alert";
$haloe_config["dateField"] = "date";
$haloe_config["timeField"] = "time";
$haloe_config["priorityField"] = "priority";
$haloe_config["facilityField"] = "facility";
$haloe_config["hostField"] = "host";
$haloe_config["textField"] = "msg";
$haloe_config["id"] = "seq";

// Priority colors, change/add/delete to suit
$haloe_colors["Emergency"] = "FF0000";
$haloe_colors["Critical"] = "FF0000";
$haloe_colors["alert"] = "FF0000";
$haloe_colors["err"] = "FFAB00";
$haloe_colors["warn"] = "FFFF00";
// $haloe_colors["Notice"] = "FFAB00";
// $haloe_colors["Info"] = "FFAB00";
$haloe_colors["Debug"] = "D0D0D0";

?>

Here is the sql file (bundled with haloe):
--
-- Table structure for table `syslog`
--

CREATE TABLE syslog (
facility varchar(10) default NULL,
priority varchar(10) default NULL,
`date` date default NULL,
`time` time default NULL,
host varchar(128) default NULL,
message text,
seq int(10) unsigned NOT NULL auto_increment,
PRIMARY KEY (seq)
) TYPE=MyISAM;

-- --------------------------------------------------------

--
-- Table structure for table `syslog_alert`
--

CREATE TABLE syslog_alert (
id int(10) NOT NULL auto_increment,
name varchar(255) NOT NULL default '',
`type` varchar(16) NOT NULL default '',
message text NOT NULL,
`user` varchar(32) NOT NULL default '',
`date` int(16) NOT NULL default '0',
email text NOT NULL,
PRIMARY KEY (id)
) TYPE=MyISAM;

-- --------------------------------------------------------

--
-- Table structure for table `syslog_incoming`
--

CREATE TABLE syslog_incoming (
facility varchar(10) default NULL,
priority varchar(10) default NULL,
`date` date default NULL,
`time` time default NULL,
host varchar(128) default NULL,
message text,
seq int(10) unsigned NOT NULL auto_increment,
`status` tinyint(4) NOT NULL default '0',
PRIMARY KEY (seq)
) TYPE=MyISAM;

-- --------------------------------------------------------

--
-- Table structure for table `syslog_remove`
--

CREATE TABLE syslog_remove (
id int(10) NOT NULL auto_increment,
name varchar(255) NOT NULL default '',
`type` varchar(16) NOT NULL default '',
message text NOT NULL,
`user` varchar(32) NOT NULL default '',
`date` int(16) NOT NULL default '0',
PRIMARY KEY (id)
) TYPE=MyISAM;


unfortunately I think I see the problem... message and msg??
User avatar
nahun
Cacti User
Posts: 92
Joined: Wed Feb 15, 2006 11:27 pm
Location: Idaho
Contact:

Post by nahun »

klr0514 wrote: $haloe_config["textField"] = "msg";
You need to at least change that to:

Code: Select all

$haloe_config["textField"] = "message";
Your syslog program should also have 'message' in the INSERT statement in its config file.
[size=75]Solaris 10 x86 [color=red][b]||[/b][/color] Cacti - 0.8.7 [color=red][b]||[/b][/color] MySQL - 5.0.45 [color=red][b]||[/b][/color] PHP - 5.2.6 [color=red][b]||[/b][/color] RRDTool - 1.2.23 [color=red][b]||[/b][/color] NET-SNMP - 5.4.1 [color=red][b]||[/b][/color] Syslog-ng 2.0.5
[url=http://www.indigo-networks.com]indigo-networks.com[/url][/size]
klr0514
Posts: 27
Joined: Tue Apr 04, 2006 8:19 am
Contact:

Post by klr0514 »

Changing "msg" to "message" worked, but my syslog-ng.conf file is pointing to 'msg'... Should I also change this?
template("INSERT INTO syslog_incoming (host, facility, priority, level, tag, dat
e, time, program, msg)
VALUES ( '$HOST', '$FACILITY', '$PRIORITY', '$LEVEL', '$TAG', '$YEAR-$MONTH-$DAY
', '$HOUR:$MIN:$SEC', '$PROGRAM', '$MSG' );\n") template-escape(yes)); };

to this:
template("INSERT INTO syslog_incoming (host, facility, priority, level, tag, dat
e, time, program, message)
VALUES ( '$HOST', '$FACILITY', '$PRIORITY', '$LEVEL', '$TAG', '$YEAR-$MONTH-$DAY', '$HOUR:$MIN:$SEC', '$PROGRAM', '$MESSAGE' );\n") template-escape(yes)); };
User avatar
nahun
Cacti User
Posts: 92
Joined: Wed Feb 15, 2006 11:27 pm
Location: Idaho
Contact:

Post by nahun »

yes, I would change all the instances of 'msg' to 'message'. I use 'msg' in all my syslog stuff, but I don't think it matters as long as everything is consistent.
[size=75]Solaris 10 x86 [color=red][b]||[/b][/color] Cacti - 0.8.7 [color=red][b]||[/b][/color] MySQL - 5.0.45 [color=red][b]||[/b][/color] PHP - 5.2.6 [color=red][b]||[/b][/color] RRDTool - 1.2.23 [color=red][b]||[/b][/color] NET-SNMP - 5.4.1 [color=red][b]||[/b][/color] Syslog-ng 2.0.5
[url=http://www.indigo-networks.com]indigo-networks.com[/url][/size]
klr0514
Posts: 27
Joined: Tue Apr 04, 2006 8:19 am
Contact:

Post by klr0514 »

Thanks so much for all the help!! (both now and in the past)... This forum (and the tool) is invaluable...
spoonman
Cacti User
Posts: 305
Joined: Tue May 03, 2005 8:54 am
Location: GA

Post by spoonman »

Anyone getting this message while adding a remove rule ??

Notice: Undefined variable: query in /home/www/htdocs/cacti/plugins/haloe/functions.php on line 47

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/www/htdocs/cacti/plugins/haloe/functions.php on line 47

Notice: Undefined variable: query in /home/www/htdocs/cacti/plugins/haloe/functions.php on line 47

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/www/htdocs/cacti/plugins/haloe/functions.php on line 47

Warning: Cannot modify header information - headers already sent by (output started at /home/www/htdocs/cacti/plugins/haloe/functions.php:47) in /home/www/htdocs/cacti/plugins/haloe/haloe_remove.php on line 51
qwertz
Cacti User
Posts: 98
Joined: Thu Feb 16, 2006 9:20 am

Post by qwertz »

Yes i have this message too.

But despite this message the rule is accepted and works correctly ...

Qwertz
cigamit
Developer
Posts: 3363
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

spoonman wrote:Anyone getting this message while adding a remove rule ??

Notice: Undefined variable: query in /home/www/htdocs/cacti/plugins/haloe/functions.php on line 47
Already fixed this in SVN, I will look at pushing out a new version fairly soon.
spoonman
Cacti User
Posts: 305
Joined: Tue May 03, 2005 8:54 am
Location: GA

Post by spoonman »

Very Nice.

Thanks.
spoonman
Cacti User
Posts: 305
Joined: Tue May 03, 2005 8:54 am
Location: GA

Post by spoonman »

Another Question about syslog plugin. I've tried to set an alert against one of the logs coming in from localhost. How does the email portion work?? I didnt see any settings to choose like for Thold...I've only set up one email alert but hadnt' gotten an email?? Any thing i need to do or check to get that working?

THX
User avatar
nahun
Cacti User
Posts: 92
Joined: Wed Feb 15, 2006 11:27 pm
Location: Idaho
Contact:

Post by nahun »

spoonman wrote:Another Question about syslog plugin. I've tried to set an alert against one of the logs coming in from localhost. How does the email portion work?? I didnt see any settings to choose like for Thold...I've only set up one email alert but hadnt' gotten an email?? Any thing i need to do or check to get that working?
There were some problems getting email alerts to work for me. Look back in this thread to like page 8, you'll see all what we did. I would just wait for cigamit's new version as I'm sure he'll have it fixed.
[size=75]Solaris 10 x86 [color=red][b]||[/b][/color] Cacti - 0.8.7 [color=red][b]||[/b][/color] MySQL - 5.0.45 [color=red][b]||[/b][/color] PHP - 5.2.6 [color=red][b]||[/b][/color] RRDTool - 1.2.23 [color=red][b]||[/b][/color] NET-SNMP - 5.4.1 [color=red][b]||[/b][/color] Syslog-ng 2.0.5
[url=http://www.indigo-networks.com]indigo-networks.com[/url][/size]
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests