Groupwise Statistics Script(s)

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

Moderators: Moderators, Developers

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

Groupwise Statistics Script(s)

#1 Post by skirkybaby » Tue May 10, 2005 4:58 am

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:

#2 Post by pbulteel » Tue May 10, 2005 5:30 am

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

#3 Post by skirkybaby » Tue May 10, 2005 5:37 am

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:

#4 Post by pbulteel » Tue May 10, 2005 5:50 am

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

#5 Post by skirkybaby » Tue May 10, 2005 6:12 am

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)

#6 Post by skirkybaby » Tue May 10, 2005 10:49 am

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 1024 times
booyah

chrisg
Posts: 1
Joined: Sat Jun 11, 2005 2:10 am

#7 Post by chrisg » Sat Jun 11, 2005 2:13 am

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

#8 Post by skirkybaby » Mon Jun 13, 2005 8:01 am

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

#9 Post by skirkybaby » Mon Jun 13, 2005 8:11 am

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 1278 times
gw_stats.jpg
Screenshot of script in action
gw_stats.jpg (155.13 KiB) Viewed 29837 times
booyah

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

Thread

#10 Post by skirkybaby » Mon Jun 13, 2005 8:40 am

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...

#11 Post by karlin » Tue Jun 14, 2005 2:25 am

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:

#12 Post by skirkybaby » Tue Jun 14, 2005 2:35 am

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

#13 Post by karlin » Tue Jun 14, 2005 12:58 pm

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...

#14 Post by stuartl » Thu Jul 07, 2005 2:53 pm

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

#15 Post by Jorrit » Fri Jul 08, 2005 1:24 am

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

Post Reply