Parallelizing snmp gets to hosts

Anything that you think should be in Cacti.

Moderators: Developers, Moderators

Post Reply
pbulteel
Cacti User
Posts: 150
Joined: Fri Sep 05, 2003 9:20 am
Location: London
Contact:

Parallelizing snmp gets to hosts

Post by pbulteel »

I know cacti has cactid and the perl version of cmd.php, but I was wondering how hard it would be and if anyone had thought of parallelizing the snmpget - or even substituting snmpget with scripts to parallelize it.

Currently an snmpget is run for each snmpquery. This happens even if you're going to poll the same host for multiple values.

Has anyone thought of writing a script or app that can poll mutiple values in one query? For example an ssh script that could go to a server and run a command for the values and return them to rrd/cacti. This way we could get 100s of values in one single query instead of having to query the host for each value.

I'm currently exploring this option so if anyone else is interested, I could try to provide anything I come up with. I was just wondering if anyone else had thought of this and implemented something similar.
uname -a
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

I was using similar solution for cacti 0.6x line. I had parallel snmp operations however I went a bit further. Instead of running them on one machine I wrote some scripts that were working as distributed pollers (I have large WAN to monitor and I used machines in many locations for this purpose). I also used snmpbulkwalk in these scripts instead of snmpget/snmpwalk - this gave me considerably speedup in polling. Shortly the scripts poll the stats from assigned devices to them and then write these stats to a special mysql table on cacti server. Cacti from the other side just needs to read these values locally from mysql which works much faster than snmp polling. At the moment I have one cacti server with 8 remote pollers, about 38000 DS-es, 7000 grahs (97000 graphs items).

I did not program with php before so my changes were dirty hacks rather... at the end I realized I don't have a clean piece of code ready to put into main cacti distribution. I hope some day to implement similar solution in cacti 0.8x line easy enouch to be integrated with official cacti source code.

I discussed this a bit some time ago here:
http://www.raxnet.net/board/viewtopic.p ... ight=#1679
http://www.raxnet.net/board/viewtopic.php?p=3094

- bulek
olkro
Posts: 1
Joined: Sat Sep 06, 2003 1:47 pm

Parallelizing snmp gets to hosts

Post by olkro »

I tried to make polling a host as easy as possible from within CACTI.
Therefore i only work with templates which call for one specific type of host one script.
For Example, get some interesting parameters from a CISCO WGB350:

#!/usr/bin/perl

$ret=`snmpwalk $ARGV[0] $ARGV[1] .1.3.6.1.4.1.551.2.2.1.7.3.1.10 | grep 6.0.64. | cut -d= -f2 | cut -b2-`;
chomp($ret);
print "Signal:".$ret." ";

$ret=`snmpwalk $ARGV[0] $ARGV[1] .1.3.6.1.4.1.551.2.2.1.7.3.1.16 | grep 6.0.64. | cut -d= -f2 | cut -b2-`;
chomp($ret);
print "BitRate:".$ret." ";

$ret=`snmpwalk $ARGV[0] $ARGV[1] .1.3.6.1.4.1.551.2.2.1.7.3.1.17 | grep 6.0.64. | cut -d= -f2 | cut -b2-`;
chomp($ret);
print "Quality:".$ret." ";

$ret=`snmpwalk $ARGV[0] $ARGV[1] .1.3.6.1.4.1.551.2.2.1.7.3.1.18 | grep 6.0.64. | cut -d= -f2 | cut -b2-`;
chomp($ret);
print "SignalDB:".$ret." ";

$ret=`snmpwalk $ARGV[0] $ARGV[1] .1.3.6.1.4.1.551.2.2.1.7.3.1.13 | grep 6.0.64. | cut -d= -f2 | cut -d: -f2 | cut -b2-`;
chomp($ret);
print "TxRetry:".$ret;

Cacti executes this script and gets all the values in one go.
surely not parallel, but comfortable :)
Maybee this helps you

But nevertheless, i am looking forward to the cactid which hopefully works like the nagiosd from http://www.nagios.org/
parallel fast and stable

oliver.kronawithleithner@tiwag.at[/b]
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest