CaMM (Cacti Message Management) plugin v1.6.7 2010-08-26
Moderators: Developers, Moderators
2 L0gRuS - And what in you snmptrapd.log ?
Edit: data may be incorrect if they come in different format that in snmptt.ini. May be you also need capture snmp trap in interface by tcpdump
Edit: data may be incorrect if they come in different format that in snmptt.ini. May be you also need capture snmp trap in interface by tcpdump
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
[size=75]Sorry for my English. [/size]
Hi Gthe,
cheers,
N
Are you saying the syslog cacti plugin is a requirement for SNMPTT syslog? That's not very clear from your statement where you say to install syslog-ng:gthe wrote:Do you read this - http://forums.cacti.net/viewtopic.php?t=26040
I didn't follow this since I already know how to install syslog-ng and had it installed. If syslog-ng needs to be configured in a particular way I think better to copy that part of the thread to your original post to minimise the cross-referencing confusion Or do I need to use syslog plugin and follow the whole guide?gthe wrote:1. Install syslog-ng ([HOWTO] Install Syslog-ng on Linux/Unix Cacti vers - http://forums.cacti.net/viewtopic.php?t=26040)
cheers,
N
ok. Do you do this:
noflies wrote: 6. Create the /sbin/syslogtomysql bash script.NOTE: Change the above user credentials to your specific installation.Code: Select all
#!/bin/bash if [ ! -e /tmp/mysql.pipe ]; then mkfifo /tmp/mysql.pipe fi while [ -e /tmp/mysql.pipe ] do mysql -u <cacti_dbuser> --password=<cacti_dbpass> <cacti_db_name> < /tmp/mysql.pipe done
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
[size=75]Sorry for my English. [/size]
Ok the penny dropped and I have this working now. GTHE this is a very cool plugin as I have mentioned before.
So here is the process followed. This should work for anyone who doesn't want to use the syslog cacti plugin, but does want to log direct to the cacti database. If you are just using camm I don't see any reason to create a separate syslog database.
1) Create the plugin_camm_syslog table
2) Edit the /etc/init.d/syslog-ng file
INSERT the following line AFTER the "start() {" line
INSERT the following line AFTER the "stop() {" line
3) Create the /sbin/syslogtomysql bash script.
ENTER the following text
NOTE: Change the above user credentials to your specific installation.
4) Change the /sbin/syslogtomysql file permissions to 755 owned by root:root (if it is not already)
5) ADD the following lines to the /etc/syslog-ng/syslog-ng.conf file to the END of the file
NOTE: The "template(" line begins with "template(" and ends with the $MSG' );\n"). The line may appear to wrap due to the length of the line. MAKE SURE your config file does not break the line apart.
6) Restart the syslog-ng daemon
7) Change CAMM db name to 'cacti' in settings!
8. Generate syslog and verify that it is present in the database
So here is the process followed. This should work for anyone who doesn't want to use the syslog cacti plugin, but does want to log direct to the cacti database. If you are just using camm I don't see any reason to create a separate syslog database.
1) Create the plugin_camm_syslog table
Code: Select all
shell> mysql --user=<cacti_user> --password=<cacti_pass> cacti < <cacti_path>/plugins/camm/sql/plugin_camm_syslog.sql
INSERT the following line AFTER the "start() {" line
Code: Select all
/sbin/syslogtomysql &
Code: Select all
killall -9 syslogtomysql > /dev/null
ENTER the following text
Code: Select all
#!/bin/bash
if [ ! -e /tmp/mysql.pipe ]; then
mkfifo /tmp/mysql.pipe
fi
while [ -e /tmp/mysql.pipe ]
do
mysql -u <cacti_user> --password=<cacti_pass> cacti < /tmp/mysql.pipe
done
4) Change the /sbin/syslogtomysql file permissions to 755 owned by root:root (if it is not already)
Code: Select all
shell> chmod 755 /sbin/syslogtomysql
shell> chown root:root /sbin/syslogtomysql
Code: Select all
source net {
udp();
};
destination d_mysql {
pipe("/tmp/mysql.pipe"
template("INSERT INTO plugin_camm_syslog (host, facility, priority, date, time, message) VALUES ( '$HOST', '$FACILITY', '$PRIORITY', '$YEAR-$MONTH-$DAY', '$HOUR:$MIN:$SEC', '$MSG' );\n")
template-escape(yes)
);
};
log { source(net); destination(d_mysql); };
log { source(s_sys); destination(d_mysql); };
6) Restart the syslog-ng daemon
Code: Select all
shell> /etc/init.d/syslog-ng restart
8. Generate syslog and verify that it is present in the database
Code: Select all
mysql> SELECT * from plugin_camm_syslog;
-
- Cacti Guru User
- Posts: 1884
- Joined: Mon Oct 16, 2006 5:57 am
- Location: United Kingdom
- Contact:
One thing I have noticed with CAMM is that the auto-purging of records doesn't seem to work ?
I might have understood this incorrectly, but I read it that (I have mine set for 3 days - Syslogs) after 3 days, the data should be removed from the database ? At present, I'm having to execute commands manually in MySQL to keep the size of the DB down.
I might have understood this incorrectly, but I read it that (I have mine set for 3 days - Syslogs) after 3 days, the data should be removed from the database ? At present, I'm having to execute commands manually in MySQL to keep the size of the DB down.
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
What is the "max rows in table" and "max rows per device in day" config ?mcutting wrote:One thing I have noticed with CAMM is that the auto-purging of records doesn't seem to work ?
I might have understood this incorrectly, but I read it that (I have mine set for 3 days - Syslogs) after 3 days, the data should be removed from the database ? At present, I'm having to execute commands manually in MySQL to keep the size of the DB down.
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
[size=75]Sorry for my English. [/size]
today i see new error
i think what plugin want delete rows (upper limit) but it can't
why it cant?
Code: Select all
04/17/2009 09:02:05 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1054', SQL:"DELETE FROM `plugin_camm_snmptt` where (date(`sys_date`) = date('2009-04-15')) and `hostname`='xxx.xxx.xxx.xxx' order by `traptime` desc limit 1518'
why it cant?
Cacti v.087g + PAv2.9
Thaks for reporting. Fixed file in attach. Please replace it.
- Attachments
-
- poller_camm.rar
- (4.65 KiB) Downloaded 182 times
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
[size=75]Sorry for my English. [/size]
L0gRuS, sorry, my mistake.
Fix in attach. I also update attach in first post.
Thanks for reporting.
Fix in attach. I also update attach in first post.
Thanks for reporting.
- Attachments
-
- camm_functions.rar
- (5.72 KiB) Downloaded 218 times
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
[size=75]Sorry for my English. [/size]
-
- Cacti Guru User
- Posts: 1884
- Joined: Mon Oct 16, 2006 5:57 am
- Location: United Kingdom
- Contact:
Syslog Purge - Not Working ?
Hi gthe,
I've been enjoying this plugin for several weeks now. The only "bug" I have noticed now is that the auto purge of records doesn't seem to work (for me anyway). I have the max rows set at 40,000, and am currently at 107,000 rows - no auto prune so far.
Any thoughts ? I have written a custom sql query that I have to fire off manually in phpMyAdmin to dump the records out of the syslog db to prevent it from becoming huge.
Thanks
I've been enjoying this plugin for several weeks now. The only "bug" I have noticed now is that the auto purge of records doesn't seem to work (for me anyway). I have the max rows set at 40,000, and am currently at 107,000 rows - no auto prune so far.
Any thoughts ? I have written a custom sql query that I have to fire off manually in phpMyAdmin to dump the records out of the syslog db to prevent it from becoming huge.
Thanks
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
mcutting, can you show me result of sql query:
Code: Select all
SELECT * FROM settings where name like 'camm_autop%' or name like 'camm_sys%';
My cacti plugin -[url=http://forums.cacti.net/viewtopic.php?p=156769#156769]CaMM[/url]
[size=75]Sorry for my English. [/size]
[size=75]Sorry for my English. [/size]
Who is online
Users browsing this forum: No registered users and 2 guests