Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Groupwise Statistics Script(s)
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates
Author Message
skirkybaby



Joined: 10 May 2005
Posts: 8
Location: Somerset, UK

PostPosted: Tue May 10, 2005 4:58 am    Post subject: Groupwise Statistics Script(s) Reply with quote

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
Back to top
pbulteel
Cacti User


Joined: 05 Sep 2003
Posts: 150
Location: London

PostPosted: Tue May 10, 2005 5:30 am    Post subject: Reply with quote

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
Back to top
skirkybaby



Joined: 10 May 2005
Posts: 8
Location: Somerset, UK

PostPosted: Tue May 10, 2005 5:37 am    Post subject: Output Reply with quote

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!
Back to top
pbulteel
Cacti User


Joined: 05 Sep 2003
Posts: 150
Location: London

PostPosted: Tue May 10, 2005 5:50 am    Post subject: Reply with quote

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
Back to top
skirkybaby



Joined: 10 May 2005
Posts: 8
Location: Somerset, UK

PostPosted: Tue May 10, 2005 6:12 am    Post subject: Ahh Reply with quote

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
Back to top
skirkybaby



Joined: 10 May 2005
Posts: 8
Location: Somerset, UK

PostPosted: Tue May 10, 2005 10:49 am    Post subject: Groupwise Statistics Script(s) Reply with quote

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



gwia_stats.rar
 Description:
attached perl script in rar file

Download
 Filename:  gwia_stats.rar
 Filesize:  548 Bytes
 Downloaded:  487 Time(s)

Back to top
chrisg



Joined: 11 Jun 2005
Posts: 1

PostPosted: Sat Jun 11, 2005 2:13 am    Post subject: Reply with quote

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
Back to top
skirkybaby



Joined: 10 May 2005
Posts: 8
Location: Somerset, UK

PostPosted: Mon Jun 13, 2005 8:01 am    Post subject: Additions Reply with quote

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
Back to top
skirkybaby



Joined: 10 May 2005
Posts: 8
Location: Somerset, UK

PostPosted: Mon Jun 13, 2005 8:11 am    Post subject: Works lovely Reply with quote

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



gw_stats.jpg
 Description:
Screenshot of script in action
 Filesize:  155.13 KB
 Viewed:  14009 Time(s)

gw_stats.jpg



GwiaStats.rar
 Description:
Rar File containing required script and template files.

Download
 Filename:  GwiaStats.rar
 Filesize:  38.28 KB
 Downloaded:  685 Time(s)

Back to top
skirkybaby



Joined: 10 May 2005
Posts: 8
Location: Somerset, UK

PostPosted: Mon Jun 13, 2005 8:40 am    Post subject: Thread Reply with quote

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

-Skirky
Back to top
karlin



Joined: 06 Feb 2004
Posts: 3
Location: Göteborg, Sweden

PostPosted: Tue Jun 14, 2005 2:25 am    Post subject: Error... Reply with quote

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
Back to top
skirkybaby



Joined: 10 May 2005
Posts: 8
Location: Somerset, UK

PostPosted: Tue Jun 14, 2005 2:35 am    Post subject: Reply with quote

not as far as I am aware ... what errors is it giving you?
Back to top
karlin



Joined: 06 Feb 2004
Posts: 3
Location: Göteborg, Sweden

PostPosted: Tue Jun 14, 2005 12:58 pm    Post subject: Reply with quote

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

Karl
Back to top
stuartl



Joined: 07 Jul 2005
Posts: 11

PostPosted: Thu Jul 07, 2005 2:53 pm    Post subject: Same Problem... Reply with quote

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
Back to top
Jorrit



Joined: 16 Jun 2005
Posts: 2

PostPosted: Fri Jul 08, 2005 1:24 am    Post subject: Reply with quote

Same problem here no error's nothing the screen just flashes
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates All times are GMT - 5 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 



Powered by phpBB © 2001, 2005 phpBB Group