Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Tue May 21, 2019 8:43 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 38 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Groupwise Statistics Script(s)
PostPosted: Tue May 10, 2005 4:58 am 
Offline

Joined: Tue May 10, 2005 4:39 am
Posts: 8
Location: Somerset, UK
Hi,

Was wondering if someone could help. I have made a groupwise statistics perl script which I plan on expanding to cover everything useful, so far it only checks GWIA stats. However all my graphs dont seem to show any data and just report NAN, in regards to error outputs im getting the following two lines in the log file:



Code:
05/10/2005 11:40:03 AM - CMDPHP: Poller[0] Host[9] CMD: /usr/local/cacti/scripts/gwia_stats.pl, output: U


Followed by:

Code:
05/10/2005 11:40:04 AM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/html/cacti/rra/mph_mail_groupwise_gwiamsgsouttotal_187.rrd --template 1115721602:U


The script itself is as below:

Code:
#!/usr/bin/perl

my $hostname = $ARGV[0];

chomp $hostname;

if ($hostname eq '') {
        $hostname = "localhost";
}


$output = `snmpwalk -v 1 -c public $hostname .1.3.6.1.4.1.23.2.70.1 `;

$output =~ /SNMPv2-SMI::enterprises.23.2.70.1.7.0 = Counter32: (.*)/;
print "GWIAmsgsoutTotal:".$1." ";
$output =~ /SNMPv2-SMI::enterprises.23.2.70.1.8.0 = Counter32: (.*)/;
print "GWIAmsgsinTotal:".$1." ";
$output =~ /SNMPv2-SMI::enterprises.23.2.70.1.11.0 = Counter32: (.*)/;
print "GWIAerrorsout:".$1." ";
$output =~ /SNMPv2-SMI::enterprises.23.2.70.1.12.0 = Counter32: (.*)/;
print "GWIAerrorsin:".$1." ";
$output =~ /SNMPv2-SMI::enterprises.23.2.70.1.19.0 = Counter32: (.*)/;
print "GWIAmsgsout10mins:".$1." ";
$output =~ /SNMPv2-SMI::enterprises.23.2.70.1.20.0 = Counter32: (.*)/;
print "GWIAmsgsin10mins:".$1." ";



For the Data Template ive used the same names as the outputs from the scripts. I was wondering if it has something to do with the Data Source type?

Thanks for any help.

Cheers,

Simon

_________________
booyah


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 10, 2005 5:30 am 
Offline
Cacti User

Joined: Fri Sep 05, 2003 9:20 am
Posts: 150
Location: London
Run the script manually... What does the output look like?

Another question. Since Cacti uses SNMP and is built to use SNMP why not create a template that will just grab those values from the OIDs. This shouldn't be hard to do.

-P

_________________
uname -a


Top
 Profile  
 
 Post subject: Output
PostPosted: Tue May 10, 2005 5:37 am 
Offline

Joined: Tue May 10, 2005 4:39 am
Posts: 8
Location: Somerset, UK
The output of running the script manually is :

Code:
GWIAmsgsoutTotal:42285 GWIAmsgsinTotal:83175 GWIAerrorsout:0 GWIAerrorsin:0 GWIAmsgsout10mins:28 GWIAmsgsin10mins:18


Which is all correct so far...

Was going to do it as a script as the amount of information I ultimately plan to collect was just easier to type and add as a script. But will shortly be considering adding the OIDs if I cant get it working! :)

_________________
booyah


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 10, 2005 5:50 am 
Offline
Cacti User

Joined: Fri Sep 05, 2003 9:20 am
Posts: 150
Location: London
Ok, and when you run the poller by hand? do you also get the same error? You might try making the script do something like "perl /script.../gwia_stats.pl" instead of just the script itself. Look at one of the other scripts to see if you get the same output (of how the command is executing.)

-P

_________________
uname -a


Top
 Profile  
 
 Post subject: Ahh
PostPosted: Tue May 10, 2005 6:12 am 
Offline

Joined: Tue May 10, 2005 4:39 am
Posts: 8
Location: Somerset, UK
Ran the poller by hand - it was a rights issue, all ok now - for some reason the graph value for msgs out is half of what it should be but i expect ive just done the wrong thing for that somewhere. All ok now :)

Thanks for your help

-skirk

_________________
booyah


Top
 Profile  
 
 Post subject: Groupwise Statistics Script(s)
PostPosted: Tue May 10, 2005 10:49 am 
Offline

Joined: Tue May 10, 2005 4:39 am
Posts: 8
Location: Somerset, UK
I have finished the script - just have to add them all too templates.

Its called gwia_stats.pl but actually covers POA and MTA also, just selects what I feel are the most relevant and useful statistics to monitor. Uptime would be helpful but im still working on that.
Have attached here if anyone wants to borrow the script, once I have sorted templates I will stick it under addons fully working, hope this is ok.

Cheers,

Skirk


Attachments:
File comment: attached perl script in rar file
gwia_stats.rar [548 Bytes]
Downloaded 1013 times

_________________
booyah
Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 11, 2005 2:13 am 
Offline

Joined: Sat Jun 11, 2005 2:10 am
Posts: 1
Any update on templates? THe perl script is clean and works great...I am really anxious of getting a good baseline on our GW system.

Chris G


Top
 Profile  
 
 Post subject: Additions
PostPosted: Mon Jun 13, 2005 8:01 am 
Offline

Joined: Tue May 10, 2005 4:39 am
Posts: 8
Location: Somerset, UK
Apologies! I totally forgot about this post, yeah I now have ours all working, but have had to specify the IP in the script itself as I couldnt get it to parse the information over properly. Shall get this all packaged up and templates uploaded asap. Cheers

-skirky

_________________
booyah


Top
 Profile  
 
 Post subject: Works lovely
PostPosted: Mon Jun 13, 2005 8:11 am 
Offline

Joined: Tue May 10, 2005 4:39 am
Posts: 8
Location: Somerset, UK
Ok here is the finished thing - does actually work without specifying the IP address properly now. Should be able to just copy the script file to the scripts directory and import all teh appropriate templates - includes a modified netware template for a GroupWise server as a host template - but install seperately so will not ruin any others.

Hope everyone finds it useful. Attached is a screenshot of a few of the graphs I have created with it as well.

Cheers,

Skirky


Attachments:
File comment: Screenshot of script in action
gw_stats.jpg
gw_stats.jpg [ 155.13 KiB | Viewed 29583 times ]
File comment: Rar File containing required script and template files.
GwiaStats.rar [38.28 KiB]
Downloaded 1267 times

_________________
booyah
Top
 Profile  
 
 Post subject: Thread
PostPosted: Mon Jun 13, 2005 8:40 am 
Offline

Joined: Tue May 10, 2005 4:39 am
Posts: 8
Location: Somerset, UK
Could a moderator or an Admin move this thread to the Scripts and Other Addons forum please? Thanks

-Skirky

_________________
booyah


Top
 Profile  
 
 Post subject: Error...
PostPosted: Tue Jun 14, 2005 2:25 am 
Offline

Joined: Fri Feb 06, 2004 12:38 pm
Posts: 3
Location: Göteborg, Sweden
Hi

Trying to import the XML files, but my cacit installation do not like the files...
Have imported before so that part of cacti is working.
Using Cacti 0.8.6d
have also put the gwia_stats.pl to the scripts directory.

Any think that I missed ?

Karl


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 14, 2005 2:35 am 
Offline

Joined: Tue May 10, 2005 4:39 am
Posts: 8
Location: Somerset, UK
not as far as I am aware ... what errors is it giving you?

_________________
booyah


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 14, 2005 12:58 pm 
Offline

Joined: Fri Feb 06, 2004 12:38 pm
Posts: 3
Location: Göteborg, Sweden
No error even if I set to DEBUG mode for the cacti.log file.

Karl


Top
 Profile  
 
 Post subject: Same Problem...
PostPosted: Thu Jul 07, 2005 2:53 pm 
Offline

Joined: Thu Jul 07, 2005 2:44 pm
Posts: 11
Templates are not being imported.

Cacti does not return any errors or successes. It simply refreshes the page and clears the Import Template from File field. The same occurs if you import the XML directly.

I have tried to import all the of templates in the .rar file and they all produce the same result.

I've successfully imported templates for other addons.

Any suggestions?
Thanks.

Fedora Core 3
Cacti .8.6e
PHP 5.0.4
RRDTool 1.2.9


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 08, 2005 1:24 am 
Offline

Joined: Thu Jun 16, 2005 3:21 am
Posts: 2
Same problem here no error's nothing the screen just flashes


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 38 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: Google [Bot] and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group