Forward SNMP Trap to HP OVO

Anything that you think should be in Cacti.

Moderators: Developers, Moderators

farhan
Posts: 47
Joined: Sat Nov 12, 2005 6:55 am

Forward SNMP Trap to HP OVO

Post by farhan »

Hi,

I have been using cacti for a long time. And it is awsome.

Ii it possible to forward snmp trap from cacti to HP OVO in near future . If

it happens then it would be great.

Thanks,
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

What traps, cacti doesn't generate traps....

What are you looking for?
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
farhan
Posts: 47
Joined: Sat Nov 12, 2005 6:55 am

Post by farhan »

Hi,

Thanks for reply. I have been using thold, nagios and Syslog-ng plugins

under cacti. Suppose if there is cisco interface down in syslog, how can

we forward trap to HP OVO. Any idea to forward these alerts to HP OVO?

Might be it is irrelevant to cacti development. But I need this

Thanks,
cigamit
Developer
Posts: 3369
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

farhan wrote:Hi,

Thanks for reply. I have been using thold, nagios and Syslog-ng plugins

under cacti. Suppose if there is cisco interface down in syslog, how can

we forward trap to HP OVO. Any idea to forward these alerts to HP OVO?

Might be it is irrelevant to cacti development. But I need this

Thanks,
I am not sure about forwarding traps, but it would be fairly simple to allow you to forward a syslog message to a remote host if a threshold is tripped. Actually, I think I will definitely add that in as an option in the future if you want it.
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Why not configure the device to send traps to OVO and then configure OVO to correctly alert on them?
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
Exo7
Cacti User
Posts: 136
Joined: Wed Jul 13, 2005 4:50 pm

Post by Exo7 »

Hi
it would be fairly simple to allow you to forward a syslog message to a remote host if a threshold is tripped
I could also use this feature. Something like launching a third party program with arguments (hostname, IP, threshold name) :

/usr/bin/logger local7.info "threshold $name tripped on host $host"

=> allow for syslog events to be send to another management server
You can use another program to generate a SNMP trap.

Is it possible, as an option, to trigger an event when the data come back to a normal status ?
cigamit
Developer
Posts: 3369
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

Exo7 wrote:Hi
it would be fairly simple to allow you to forward a syslog message to a remote host if a threshold is tripped
I could also use this feature. Something like launching a third party program with arguments (hostname, IP, threshold name) :

/usr/bin/logger local7.info "threshold $name tripped on host $host"

=> allow for syslog events to be send to another management server
You can use another program to generate a SNMP trap.

Is it possible, as an option, to trigger an event when the data come back to a normal status ?
I had already created a php script to send remote syslog alerts, just simply creates the proper packet and sends it udp. I am sure it wouldn't be hard to do the same thing with traps, I will just have to find the RFC and write a quick script.

It would have the basic functionality of thresholds, just with syslog/traps instead of emails. So yes, it would send one out when it returned to normal.
farhan
Posts: 47
Joined: Sat Nov 12, 2005 6:55 am

Post by farhan »

Thats great. When you complete your script please let us know.

Thanks
kbartoletta
Cacti User
Posts: 146
Joined: Tue Oct 04, 2005 4:20 pm
Location: suwanee, ga
Contact:

Post by kbartoletta »

I would be interested in similiar functionality. This is one of the things that is holding us up from going completely to cacti for network/server reporting and alerting. I am hoping to be able to send threshold traps to our nerve center servers. I am currently, using log file scanning to scan logs in order to generate alarms but it is kind of messy. I would also be interested in continuous alerting if possible. I am not sure about the rest of the industry but our monitoring really depends on continuous alert as it is easy to miss a clear trap given the nature of UDP
chadd
Cacti User
Posts: 382
Joined: Thu Mar 24, 2005 3:53 pm
Location: Ocoee, Florida

Post by chadd »

oddly enough, I have just received the same request from my company. They use an SNMP manager to monitor the network, and though they find the Thold alerts useful, they do not want to get emails or have to look at the web page. They want the alerts forwarded to the SNMP manager, which is a centralized point for all network alarms. So, I setup Cigamit's Thold module to log thold alerts to it's own syslog (in /var/log/CactiThold.log) and now I am in the process of writing a little perl script to parse that file and send SNMP traps to the SNMP manager. It is pretty convoluted, and it would be great to get that functionality right in the Thold module (SNMP traps), but for now that is what I am doing. When I am done, I will post the info to this thread. The right thing to do would be to write the functionality into the Thold module, but I unfortunately don't have the time, or PHP expertise to do a good job of it.
chadd
Cacti User
Posts: 382
Joined: Thu Mar 24, 2005 3:53 pm
Location: Ocoee, Florida

Syslog2SNMP trap script

Post by chadd »

Ok, here is the script I promised. Like I said before, it is that the best solution to the problem, but it works ;-). Just edit the config file to suit your needs, and make sure you edit the "path to the config file" at the top of the script to where ever you decide to put it on your system.

It was written for UNIX, so I am not sure if it will work on a Windows server, but if it doesn't, it shouldn't take much work to fix it for Windows.

It is designed to run as a Cron job, and write after your Cacti poller. So, you will need to add a line to your Cron tab (or whatever the equiv is in Windows), something like the following:

# Production Cacti Poller
*/3 * * * * cactiuser /usr/local/bin/php /cacti/prod/cacti-0.8.6g/poller.php > /dev/null
2>&1
#
# Sends Cacti Threshold Alerts found in the Cacti Threshold syslog to an SNMP Manager via SNMP traps
*/3 * * * * root /usr/local/bin/perl /usr/local/bin/script_box/syslog2snmp.pl

In case you are wondering why I run the poller every 3min instead of the "normal" 5min, it is because devices which only have a 32 bit counter, and exceed 100mg tend to roll their counters when the polling cycle is 5min. That results in really spiky graphs, and you never get a true "current" value. Changing the poller interval to 3min has fixed that on my system.

This script uses Net SNMP to send traps, so if you don't have that you will have to change the section of the script that uses that utility to use another, but again, not a show stopper.

This script also assumes you have already set up a syslog server on your machine and have the syslog messages going to their own file. Here is what you have to add (in UNIX) to your syslog.conf file to make this happen. You can use whatever name and path you want for that syslog file, just remember to change it in your syslog2snmp.conf file. Also, check the box in your Thold module settings to tell the Thold module to send your threshold alerts to syslog:

# Cacti's Thold Syslog
!CactiTholdLog
*.* /var/log/CactiThold.log



That is about it. Hope this helps someone.
Attachments
syslog2snmp.zip
This is a WinZip version.
(2.03 KiB) Downloaded 1162 times
syslog2snmp.tar.gz
This is a gzipped tar ball.
(1.87 KiB) Downloaded 1122 times
farhan
Posts: 47
Joined: Sat Nov 12, 2005 6:55 am

chadd

Post by farhan »

Thanks a lot mate. I will try and then let you know

Regards,

Farhan
tclark
Posts: 28
Joined: Mon Jul 11, 2005 7:10 pm

Post by tclark »

Is there a specific MIB needed to be loaded on the NMS to be able to receive these traps?
User avatar
lard
Cacti User
Posts: 165
Joined: Wed Jul 20, 2005 10:48 am
Location: UK - Cambridge

Post by lard »

Hi,

I would assume that it will come in with the net-snmp oid - if using openview you'll see them in the status alarms section or trapd.log file if unrecognised

I'm in need of this functionality so will check this script out on our windows servers - many thanks!
---- lard007skype ----
karias
Cacti User
Posts: 60
Joined: Wed Oct 25, 2006 10:36 am

Post by karias »

I've got this setup after a little work. The problem I'm having is the debug log has all configured thresholds coming through whether they're breached or not, so a trap is sent for each one of them. Anyone have advice on how to get around this as I'm only interested in the true threshold breaches?
[quote][b]Cacti Version[/b] - 0.8.7b
[b]Plugin Architecture[/b] - 2.1
[b]Poller Type[/b] - Cactid v
[b]Server Info[/b] - Linux 2.6.18-53.el5
[b]Web Server[/b] - Apache/2.2.3 (Red Hat)
[b]PHP[/b] - 5.1.6
[b]PHP Extensions[/b] - libxml, xml, wddx, tokenizer, sysvshm, sysvsem, sysvmsg, standard, SimpleXML, sockets, SPL, shmop, session, Reflection, pspell, posix, mime_magic, iconv, hash, gmp, gettext, ftp, exif, date, curl, ctype, calendar, bz2, zlib, pcre, openssl, apache2handler, dbase, ldap, mysqli, mysql, PDO, pdo_mysql, pdo_sqlite, snmp
[b]MySQL[/b] - 5.0.45
[b]RRDTool[/b] - 1.3rc6
[b]SNMP[/b] - 5.3.1
[b]Plugins[/b][list]Documents (docs - v0.1)
Host Info (hostinfo - v0.2)
Device Monitoring (monitor - v0.8.2)
Global Plugin Settings (settings - v0.5)
SSL Redirector (ssl - v0.1)
Thresholds (thold - v0.3.9)
Update Checker (update - v0.4)
Cacti-ReportIt (reportit - v0.6.1)[/list][/quote]
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests