aloe event console add on

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

sidewinder
Cacti User
Posts: 66
Joined: Sat Dec 06, 2003 12:44 pm
Location: Winchester, MA

aloe event console add on

Post by sidewinder »

check out the readme files for details, but it's an event console for cacti that script's can take advantage of, and/or can be used as an interface for a syslog-ng structured database.

The included script ping-probe.pl aims to demonstrate the functionality, and if you've implemented the graph_xml_view.php addon you'll get the whole picture complete with stuning visual effects.

Any feedback is welcome. If you can't make through my Dr. Seuss like install instructions let me know and i'll be happy to assist.

Cheers,

-Phil
Attachments
aloe.zip
(32.83 KiB) Downloaded 898 times
aloe-screenshot.JPG
aloe-screenshot.JPG (83.59 KiB) Viewed 17965 times
ping-probe-screenshot.JPG
ping-probe-screenshot.JPG (87.91 KiB) Viewed 17965 times
oharel
Cacti User
Posts: 84
Joined: Wed Jan 07, 2004 11:16 am

Implementing Aloe in Cacti

Post by oharel »

Hi Sidewinder,

this module seems very useful!
been struggling with this for the past few hours... i read the readme files added, but still i get confused as to what file should go where (added all the lines to the scripts already so that is not a problem) and how the xmls are implemented in the Cacti.
could you post an outline "how-to": from scratch to working module?
is it possible to use it with anything other than ping?
btw, i am using Cacti on RH9. does it matter?

thanks
oharel
sidewinder
Cacti User
Posts: 66
Joined: Sat Dec 06, 2003 12:44 pm
Location: Winchester, MA

Post by sidewinder »

what file should go where
starting from the root of cacti

aloe and its' contents go in cacti
the contents of images go in cacti/images
the contents of include go in cacti/include
the contents of scripts go in cacti/scripts
aloe.php, graph.php and graph_xml_view.php go in the cacti directory.

Make sure to make a backup of graph.php
how the xmls are implemented in the Cacti
there are 2 sets of xml. 1 is used by aloe and the ping-probe script for configuration information.
The second one is generated each time the ping-probe script is run. This is read by graph_xml_view.php and displayed in the browser. The ping-probe script queries the cacti database to get the rra file associated with the script instance, appends a .xml extention to the rra name then it outputs its results to that file name in the rra directory.
graph_xml_view.php gets called every time a request is made through cacti for a graph. It looks for the rra name of the graph being generated with a .xml extention and if found reads and displays this xml file.
i am using Cacti on RH9. does it matter
i am using it on winxp and freebsd. There is no OS dependency i am aware of.
is it possible to use it with anything other than ping
Sure is, the included script is just a working example. Any script can be modified to log to aloe db. That's kind of it's intent, a place to centralize event messages. The rest of it relies on writing smarter scripts. If your interested, drop me a line i have some other not quite ready for primetime scripts that use this too.
could you post an outline "how-to": from scratch to working module
Tough one, unfortunately time has been my enemy as of late. Most of what's been posted has been written in my very limited spare time. I intend to produce some better documentation once this situation changes.

Cheers,
-Phil
oharel
Cacti User
Posts: 84
Joined: Wed Jan 07, 2004 11:16 am

Aloe

Post by oharel »

Thanks for the explanation.

Hopefully, you will be able to compile a how-to soon.
Meanwhile, I will tackle it once more :)

-Harel
oharel
Cacti User
Posts: 84
Joined: Wed Jan 07, 2004 11:16 am

Post by oharel »

Hi Sidewinder,

finally i succeeded in installing the aloe add-on. i configured the xmls and phps to suit my needs. however, it seems that ping-probe.pl can not read the ping results. in the aloe tab i get only 100% packetloss and when running the command manually, i get:

root@dublin:/var/www/htdocs/cacti/aloe# /usr/bin/perl /var/www/htdocs/cacti-0.8.5a/scripts/ping-probe.pl 81.199.3.1
could not find ParserDetails.ini in /usr/lib/perl5/site_perl/5.8.0/XML/SAX
Mysql connect('database=cacti;host=','cacti',...) failed: Access denied for user: 'cacti@localhost' (Using password: YES) at /var/www/htdocs/cacti-0.8.5a/scripts/ping-probe.pl line 65
: ERROR: Could not find ping summary for 81.199.3.1
: INFO: The output of the ping command /bin/ping -c 4 -s 56 81.199.3.1 was:
PING 81.199.3.1 (81.199.3.1) 56(84) bytes of data.
64 bytes from 81.199.3.1: icmp_seq=1 ttl=252 time=105 ms
64 bytes from 81.199.3.1: icmp_seq=2 ttl=252 time=104 ms
64 bytes from 81.199.3.1: icmp_seq=3 ttl=252 time=105 ms
64 bytes from 81.199.3.1: icmp_seq=4 ttl=252 time=105 ms

--- 81.199.3.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3028ms
rtt min/avg/max/mdev = 104.923/105.168/105.349/0.436 ms

: ERROR: Could not find packet loss summary for 81.199.3.1
: INFO: The output of the ping command /bin/ping -c 4 -s 56 81.199.3.1 was:
PING 81.199.3.1 (81.199.3.1) 56(84) bytes of data.
64 bytes from 81.199.3.1: icmp_seq=1 ttl=252 time=105 ms
64 bytes from 81.199.3.1: icmp_seq=2 ttl=252 time=104 ms
64 bytes from 81.199.3.1: icmp_seq=3 ttl=252 time=105 ms
64 bytes from 81.199.3.1: icmp_seq=4 ttl=252 time=105 ms

--- 81.199.3.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3028ms
rtt min/avg/max/mdev = 104.923/105.168/105.349/0.436 ms

avg:0 loss:100

i really have no idea how to continue from here... it looks like a permission issue with mysql, but then, the rest of cacti is working fine.

can u shed some light?

harel
sidewinder
Cacti User
Posts: 66
Joined: Sat Dec 06, 2003 12:44 pm
Location: Winchester, MA

Post by sidewinder »

Try I will.
could not find ParserDetails.ini in /usr/lib/perl5/site_perl/5.8.0/XML/SAX
This error leads me to believe that perl could not locate XML::Simple therefore it may not be installed. You may want to check that via cpan (i XML::Simple)

and this one
Mysql connect('database=cacti;host=','cacti',...) failed: Access denied for user: 'cacti@localhost' (Using password: YES) at /var/www/htdocs/cacti-0.8.5a/scripts/ping-probe.pl line 65
may be a result of the xml::simple problem. these values are stored in aloe-config.xml and base on the error message it doesn't look like it got parsed right, or the values in aloe-config.xml may be wrong.

-Phil
User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Sidewinder,

I would like to talk with Ian about making SOME of this code mainline in future Cacti versions. We have ICMP/UDP/SNMP ping in 0.8.6, we will start to have system graphs of the results in 0.8.7. Your thoughts?

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?
oharel
Cacti User
Posts: 84
Joined: Wed Jan 07, 2004 11:16 am

Post by oharel »

Sidewinder,

thanks, fixed the ParserDetails issue.

however, the database issue still remains... :o

where is aloe taking the parameters to connect to mysql? i thought it was the aloe-config.xml file, but that is apparently not so, as i put the correct values there, and i still get the error. or it is ping-probe.pl, which goes to the aloe-config.xml and takes it from there?

harel
oharel
Cacti User
Posts: 84
Joined: Wed Jan 07, 2004 11:16 am

Post by oharel »

hmm..
fixed also the no access message by actually adding cacti@localhost user and pass. not sure if it did anything, though, because i still have the errors:
: ERROR: Could not find ping summary for 81.199.3.1
: INFO: The output of the ping command /bin/ping -c 4 -s 56 81.199.3.1 was:
PING 81.199.3.1 (81.199.3.1) 56(84) bytes of data.
64 bytes from 81.199.3.1: icmp_seq=1 ttl=252 time=105 ms
64 bytes from 81.199.3.1: icmp_seq=2 ttl=252 time=105 ms
64 bytes from 81.199.3.1: icmp_seq=3 ttl=252 time=105 ms
64 bytes from 81.199.3.1: icmp_seq=4 ttl=252 time=105 ms

same thing for packetloss summary...

--harel
sidewinder
Cacti User
Posts: 66
Joined: Sat Dec 06, 2003 12:44 pm
Location: Winchester, MA

Post by sidewinder »

oharel, yes ping-probe gets these parameters from aloe-config.xml

<cactiDBHost>
<name>Host where cacti DB is located</name>
<value>localhost</value>
</cactiDBHost>
<cactiDB>
<name>Name of the cacti Database</name>
<value>cacti</value>
</cactiDB>
<cactiDBUser>
<name>cacti DB User Name</name>
<value>cactiuser</value>
</cactiDBUser>
<cactiDBPswd>
<name>cacti DB Password</name>
<value>cactiuser</value>
</cactiDBPswd>

assuming the settings are correct in this file, the error message it looks like the file isn't getting parsed right.

I've attached a default aloe-config.xml that has been strained through dos2unix. You would have to modify it for your configuration, but can you give that a try?
Attachments
aloe-config.xml
(1.97 KiB) Downloaded 684 times
sidewinder
Cacti User
Posts: 66
Joined: Sat Dec 06, 2003 12:44 pm
Location: Winchester, MA

Post by sidewinder »

TheWitness wrote:Sidewinder,

I would like to talk with Ian about making SOME of this code mainline in future Cacti versions. We have ICMP/UDP/SNMP ping in 0.8.6, we will start to have system graphs of the results in 0.8.7. Your thoughts?

TheWitness
Sure thing. The console is quite easy to add in, but the xml output, alerting etc are kind of language dependent and right now specfic to perl. I guess the degree of difficulty would be determined by the definition of SOME.
User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Agreed. Would like to set thresholds by each Data Query and manage event management outside of ping availability, outside of the poller, in a separate package. I am still contemplating a design, your assistance would be appreciated.

I did notice your aloe looked similar to HP OpenView.

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?
oharel
Cacti User
Posts: 84
Joined: Wed Jan 07, 2004 11:16 am

Post by oharel »

thanks, i will try it out tonight or tmrw morning and let you know either way :)

harel
oharel
Cacti User
Posts: 84
Joined: Wed Jan 07, 2004 11:16 am

Post by oharel »

still same error:
ping-probe output file -> /var/www/htdocs/cacti-0.8.5a/rra/aaa_monitor_rtt_avg_935.rrd.xml
: ERROR: Could not find ping summary for 81.199.3.1
: INFO: The output of the ping command /bin/ping -c 4 -s 56 81.199.3.1 was:
PING 81.199.3.1 (81.199.3.1) 56(84) bytes of data.
etc...

hm... here is the xml u sent me, with the changes i applied
<aloe-config>
<name>aloe Configuration Settings</name>

<settings>
<debug>
<desc>Turn debug on or off (0=Off, 1=On)</desc>
<value>1</value>
</debug>

<configPath>
<name>Location of Aloe config files.</name>
<value>./aloe/</value>
</configPath>
<cactiDBHost>
<name>Host where cacti DB is located</name>
<value>localhost</value>
</cactiDBHost>
<cactiDB>
<name>Name of the cacti Database</name>
<value>cacti</value>
</cactiDB>
<cactiDBUser>
<name>cacti DB User Name</name>
<value>cacti</value>
</cactiDBUser>
<cactiDBPswd>
<name>cacti DB Password</name>
<value>my_pass</value>
</cactiDBPswd>

<aloeDBHost>
<name>Host where aloe DB is located</name>
<value>localhost</value>
</aloeDBHost>
<aloeDB>
<name>Name of the aloe DB</name>
<value>aloe</value>
</aloeDB>
<aloeDBUser>
<name>aloe DB User Name</name>
<value>aloe</value>
</aloeDBUser>
<aloeDBPswd>
<name>aloe DB Password</name>
<value>my_pass</value>
</aloeDBPswd>
<aloeLogHost>
<name>Host where aloe logs events via Syslog</name>
<value>loghost</value>
</aloeLogHost>
<aloeSysLogMethod>
<name>logging via Syslog (0=Off, 1=On)</name>
<value>0</value>
</aloeSysLogMethod>
<aloeDBLogMethod>
<name>logging via aloe DB (0=Off, 1=On)</name>
<value>1</value>
</aloeDBLogMethod>
<aloeLogFacility>
<name>Default Logging Facility</name>
<value>local3</value>
</aloeLogFacility>
<aloeSMTPLogMethod>
<name>logging via SMTP (0=Off, 1=On)</name>
<value>0</value>
</aloeSMTPLogMethod>
<aloeSMTPRelay>
<name>SMTP Relay Host</name>
<value>mailhost</value>
</aloeSMTPRelay>
<aloeSMTPFromAddress>
<name>From address used in mail message</name>
<value>aloe@somewhere.com</value>
</aloeSMTPFromAddress>
<aloeSMTPRecipient>
<name>Recipient address used in mail message</name>
<value>someone@somewhere.com</value>
</aloeSMTPRecipient>

any enlightment :)

-harel
Guest

Post by Guest »

: ERROR: Could not find ping summary for 81.199.3.1
That would be the script not finding the summary information from the ping command.

Could you run the ping command from the command shell and post the results?

/bin/ping -c 4 -s 56 81.199.3.1
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests