dump cacti alert into a log file

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
Gatorz
Posts: 9
Joined: Wed Aug 17, 2011 10:50 pm

dump cacti alert into a log file

Post by Gatorz »

is there anyone knows how to create a log from cacti alert ?
User avatar
TheWitness
Developer
Posts: 17061
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: dump cacti alert into a log file

Post by TheWitness »

You need to be more specific. The answer is a qualified yes.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Gatorz
Posts: 9
Joined: Wed Aug 17, 2011 10:50 pm

Re: dump cacti alert into a log file

Post by Gatorz »

every time cacti create an alert . i want a log from that.
User avatar
TheWitness
Developer
Posts: 17061
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: dump cacti alert into a log file

Post by TheWitness »

What type of alert and from what? Like I said, the question is too general. I'm assuming you know little of Cacti.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Gatorz
Posts: 9
Joined: Wed Aug 17, 2011 10:50 pm

Re: dump cacti alert into a log file

Post by Gatorz »

All alert that come from threshold violation.
like High CPU, High memory.
currently the cacti only send email, i want it also every alert cacti create the log for it.
Gatorz
Posts: 9
Joined: Wed Aug 17, 2011 10:50 pm

Re: dump cacti alert into a log file

Post by Gatorz »

i mean cacti create the eventlog
User avatar
TheWitness
Developer
Posts: 17061
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: dump cacti alert into a log file

Post by TheWitness »

You mean 'Windows' eventlog? It's automatic, you simply enable the syslog component and check the checkbox to do the logging that way Console->Settings->Thresholds

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Gatorz
Posts: 9
Joined: Wed Aug 17, 2011 10:50 pm

Re: dump cacti alert into a log file

Post by Gatorz »

no

i had cacti.
every violation on Cacti threshold it will be create an event then escalate trough the email. instead email escalation i want Cacti to forward the event trap into another server.

i want to run a script to forward that event into another system. the easy way to do is to read from Cacti event log.
or i run another batch file like

send " others server " EVENT, Event_Message, Timestamp, Severity

is it possible to do that ?
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: dump cacti alert into a log file

Post by noname »

Gatorz wrote: i want to run a script to forward that event into another system. the easy way to do is to read from Cacti event log.
or i run another batch file like

send " others server " EVENT, Event_Message, Timestamp, Severity

is it possible to do that ?
Thold plugin can't send the alert via other than mail. (yet?)
But (as TheWitness said) it can record its behavior to cacti.log or syslog.

So you may create a script which is invoked periodically (e.g. crontab) so that can read these log files and send alert to another server.

Otherwise, some syslog daemons (e.g. syslog-ng) can forward its records to another syslog server, and also can execute a script when its record has strings with specific pattern.

For example:
% cat /usr/local/etc/syslog-ng.conf

Code: Select all

...
source s_all {
	internal();
	unix-stream("/dev/log");
};

filter f_check {
	match("some pattern");
};

destination d_check {
	program("/usr/local/bin/check.sh");
};

log {
	source(s_all);
	filter(f_check);
	destination(d_check);
};
...
% cat /usr/local/bin/check.sh

Code: Select all

#!/bin/sh

while read MSG; do
	echo $MSG >> /var/log/check.log
	echo $MSG | /usr/bin/mailx -s "pattern found" somebody
	/usr/local/bin/snmptrap -v1 community host trap-parameters
done

exit 0
User avatar
TheWitness
Developer
Posts: 17061
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: dump cacti alert into a log file

Post by TheWitness »

As I attempted to articulate and noname reduced to the absurd ('reducio ad absurdum'), you simply log the events to syslog and then forward Cacti's Syslog to your remote system. This has been supported in thold for years.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests