Groupwise Statistics Script(s)

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

Moderators: Developers, Moderators

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

Groupwise Statistics Script(s)

Post by skirkybaby »

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: Select all

 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: Select all

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: Select all

#!/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
pbulteel
Cacti User
Posts: 150
Joined: Fri Sep 05, 2003 9:20 am
Location: London
Contact:

Post by pbulteel »

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
skirkybaby
Posts: 8
Joined: Tue May 10, 2005 4:39 am
Location: Somerset, UK
Contact:

Output

Post by skirkybaby »

The output of running the script manually is :

Code: Select all

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
pbulteel
Cacti User
Posts: 150
Joined: Fri Sep 05, 2003 9:20 am
Location: London
Contact:

Post by pbulteel »

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
skirkybaby
Posts: 8
Joined: Tue May 10, 2005 4:39 am
Location: Somerset, UK
Contact:

Ahh

Post by skirkybaby »

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
skirkybaby
Posts: 8
Joined: Tue May 10, 2005 4:39 am
Location: Somerset, UK
Contact:

Groupwise Statistics Script(s)

Post by skirkybaby »

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
gwia_stats.rar
attached perl script in rar file
(548 Bytes) Downloaded 1274 times
booyah
chrisg
Posts: 1
Joined: Sat Jun 11, 2005 2:10 am

Post by chrisg »

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
skirkybaby
Posts: 8
Joined: Tue May 10, 2005 4:39 am
Location: Somerset, UK
Contact:

Additions

Post by skirkybaby »

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
skirkybaby
Posts: 8
Joined: Tue May 10, 2005 4:39 am
Location: Somerset, UK
Contact:

Works lovely

Post by skirkybaby »

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
GwiaStats.rar
Rar File containing required script and template files.
(38.28 KiB) Downloaded 1559 times
Screenshot of script in action
Screenshot of script in action
gw_stats.jpg (155.13 KiB) Viewed 33597 times
booyah
skirkybaby
Posts: 8
Joined: Tue May 10, 2005 4:39 am
Location: Somerset, UK
Contact:

Thread

Post by skirkybaby »

Could a moderator or an Admin move this thread to the Scripts and Other Addons forum please? Thanks

-Skirky
booyah
karlin
Posts: 3
Joined: Fri Feb 06, 2004 12:38 pm
Location: Göteborg, Sweden

Error...

Post by karlin »

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
skirkybaby
Posts: 8
Joined: Tue May 10, 2005 4:39 am
Location: Somerset, UK
Contact:

Post by skirkybaby »

not as far as I am aware ... what errors is it giving you?
booyah
karlin
Posts: 3
Joined: Fri Feb 06, 2004 12:38 pm
Location: Göteborg, Sweden

Post by karlin »

No error even if I set to DEBUG mode for the cacti.log file.

Karl
stuartl
Posts: 11
Joined: Thu Jul 07, 2005 2:44 pm

Same Problem...

Post by stuartl »

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
Jorrit
Posts: 2
Joined: Thu Jun 16, 2005 3:21 am

Post by Jorrit »

Same problem here no error's nothing the screen just flashes
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests