Cannot view syslog messages for syslog-Cacti-Plugin

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
jdenver47
Posts: 1
Joined: Tue Oct 21, 2008 5:42 pm

Cannot view syslog messages for syslog-Cacti-Plugin

Post by jdenver47 »

I have installed syslog-ng, syslog cacti plugins. I have succesfully installed syslog-ng and cacti plugin. I write the syslog-ng messages to a flat file and then to the database. When syslog-ng logs messages in /var/log/messages I am able to see this message in Mysql DB ( syslog-incomming tables)

After installing the plugin, I am able to see the plugin tab in cacti.BUT I AM NOT ABLE TO SEE ANY MESSAGES DISPLAYED.I have been stuck here from days and did a lot of research. Can someone help me. Also you might need this info..

[root@csc06rh1 syslog]# php syslog_counter.php
PHP Notice: Undefined variable: syslogdb_hostname in /var/www/html/cacti/plugins/syslog/syslog_counter.php on line 49
PHP Notice: Undefined variable: syslogdb_username in /var/www/html/cacti/plugins/syslog/syslog_counter.php on line 49
PHP Notice: Undefined variable: syslogdb_password in /var/www/html/cacti/plugins/syslog/syslog_counter.php on line 49
PHP Notice: Undefined variable: syslogdb_default in /var/www/html/cacti/plugins/syslog/syslog_counter.php on line 52
Content-type: text/html
X-Powered-By: PHP/4.3.9


My syslog2mysql script
----------------------
#!/bin/bash

if [ ! -e /var/log/mysql.pipe ]
then
mkfifo /var/log/mysql.pipe
fi
while [ -e /var/log/mysql.pipe ]
do
mysql -u cactiuser --password=sample syslog < /var/log/mysql.pipe >/dev/null
done


Mysql login script
--------------------
destination d_mysql {
pipe("/var/log/mysql.pipe"
template("INSERT INTO syslog_incoming (facility, priority, date, time, host, message, seq, status)
VALUES ( '$FACILITY', '$PRIORITY', '$YEAR-$MONTH-$DAY', '$HOUR:$MIN:$SEC', '$HOST', '$MSG', '$SEQ', '$STATUS' );\n")
template-escape(yes));
};

log { source(s_sys); destination(d_mysql); };


My permissions
---------------------
[root@csc06rh1 plugins]# ls -l
total 12
-rw-r--r-- 1 root root 44 Oct 17 16:50 index.php
drwxr-xr-x 3 root root 4096 Oct 20 22:55 settings
drwxr-xr-x 5 root root 4096 Oct 21 18:10 syslog

[root@csc06rh1 plugins]# cd syslog
[root@csc06rh1 syslog]# ls -l
total 148
-rwxr-xr-x 1 root root 613 Oct 17 14:02 compatibility.php
-rwxr-xr-x 1 root root 2085 Oct 21 16:55 config.php
-rwxr-xr-x 1 root root 13858 Oct 17 14:02 functions.php
drwxr-xr-x 2 root root 4096 Oct 17 14:02 html
drwxr-xr-x 2 root root 4096 Oct 17 14:02 images
-rwxr-xr-x 1 root root 44 Oct 17 14:02 index.php
-rwxr-xr-x 1 root root 15237 Oct 17 14:02 LICENSE
-rwxr-xr-x 1 root root 3297 Oct 17 14:02 README
-rwxr-xr-x 1 root root 6623 Oct 17 14:02 setup.php
-rwxr-xr-x 1 root root 197 Oct 21 18:10 syslog2mysql.sh
-rwxr-xr-x 1 root root 9638 Oct 17 14:02 syslog_alert.php
-rwxr-xr-x 1 root root 3351 Oct 17 14:02 syslog_counter.php
-rwxr-xr-x 1 root root 17408 Oct 17 14:02 syslog.php
-rwxr-xr-x 1 root root 11804 Oct 17 14:02 syslog_process.php
-rwxr-xr-x 1 root root 9436 Oct 17 14:02 syslog_remove.php
-rwxr-xr-x 1 root root 11118 Oct 17 14:02 syslog_reports.php
-rwxr-xr-x 1 root root 2546 Oct 17 14:02 syslog.sql
drwxr-xr-x 2 root root 4096 Oct 17 14:02 template


Do you think file permissions is the cause, If so what should I change. Because I syslog-ng works fine, I can see the messages in mysql database.. Please help

Thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests