Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


[SOLVED] messed up syslog

 
Post new topic   Reply to topic    Cacti Forum Index -> Plugin General
Author Message
sepp



Joined: 21 Jun 2007
Posts: 47
Location: germany

PostPosted: Mon Jul 09, 2007 10:14 am    Post subject: [SOLVED] messed up syslog Reply with quote

huhu,

well, I think I totally destroyed everything I installed as I browsed through the forum and I assume I mixed several ways of installing this up...

What I have is:

- I see the syslog-tab in cacti
- I fixed that it had no db-connection
- I installed syslog-ng and put these lines at the end of the config:

Code:
## Log syslog-ng to mysql database
#destination d_mysql {
#file("/var/log/mysqllog/todo" owner("mysqllog") group("adm") perm(0600)
#template("USE syslog; INSERT INTO logs (host, facility, priority, level, tag, date, time, program, msg) VALUES ( '$HOST', '$FACILITY', '$PRIORITY', '$LEVEL', '$TAG', '$YEAR-$MONTH-$DAY', '$HOUR:$MIN:$SEC', '$PROGRAM', '$MSG' );\n") template-escape(yes));
#};
#
#log { source(src); destination(d_mysql); };
#


- I created this file:
/usr/local/sbin# cat mysqllog.sh
#!/bin/bash
# Write log into database
# 13.9.2004 - JW

/usr/bin/mysql -h localhost -u syslog < /var/log/mysqllog/todo
echo "" > /var/log/mysqllog/todo

and scheduled it to the crontab.

And now I am lost. I completely lost the overview what refers to what and so on... Could someone help me? I am more than willing to start from the scratch....

Many thanks,

//sepp


Last edited by sepp on Tue Jul 10, 2007 7:44 am; edited 1 time in total
Back to top
sepp



Joined: 21 Jun 2007
Posts: 47
Location: germany

PostPosted: Tue Jul 10, 2007 4:36 am    Post subject: Reply with quote

hello again,

I don't want to appear anoying, but this becomes slightly urgent as I destroyed not only the things I installed new, but also the existings net.log and this smells like trouble with my manager...

I am very new to linux as well, the only thing I know is that I had a logfile which I could tail -f before, but when I installed syslog-ng it is gone...

can somebody help me?
Back to top
sepp



Joined: 21 Jun 2007
Posts: 47
Location: germany

PostPosted: Tue Jul 10, 2007 5:08 am    Post subject: Reply with quote

ok I made a huge step forward - I could figure out how to see the messages from our network elements again - now in syslog-ng instead of the old log. now I only need to find out how to put this in the sql...
Back to top
sepp



Joined: 21 Jun 2007
Posts: 47
Location: germany

PostPosted: Tue Jul 10, 2007 7:29 am    Post subject: Reply with quote

ok, with lots of sweat and blood I made it working somehow.

Now it is the problem with SQL. I checked the syslog_incoming table and it received data. FINE!!

But, I see an SQL problem while fetching the data:

07/10/2007 02:25:50 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "SELECT host,priority,facility,date,time,seq,message FROM syslog where concat(DATE_FORMAT(date,'%Y-%m-%d'),' ',TIME_FORMAT(time,'%H:%i:%s')) BETWEEN '2007-07-09 14:25' AND '2007-07-10 14:25' ORDER BY date DESC,time DESC,host DESC LIMIT 0,30"

the problem is column "messages" which is not defined in syslog_incoming, but in syslog_alerts...

So I commented this field out in config.php, but then I get another error "undefined index" in functions.php as this is referencing the messages field.

my question: as I build everything like other users in here -> how can it work for them, but not for me???

and another question: when the next poll runs, then syslog_incoming is empty again? strange...

edit: ok, I understand why it goes out of incoming...also I could fix the message field... many thanks to everybody who at least looked at it
Back to top
sepp



Joined: 21 Jun 2007
Posts: 47
Location: germany

PostPosted: Thu Jul 12, 2007 7:52 am    Post subject: Reply with quote

one thing I forgot: really cool plugin many thanks for it !!!!!
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Plugin General All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group