Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Tue Jun 18, 2019 7:50 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 40 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: New perl scripts for monitoring Windows servers...
PostPosted: Fri Mar 14, 2003 10:13 pm 
Offline

Joined: Tue Feb 04, 2003 12:05 pm
Posts: 38
Location: Dallas, TX
Cacti v0.6.8a Extensions

ftp://216.62.51.106/pub/cacti-ext.zip

The Extensions include a network discovery add-on and perl scripts for monitoring Windows servers, managed switches, and printers.

The Windows script, w2kperf.pl, uses WMI to provide performance for server CPU, memory, disk & interface performance, no matter how many CPUs, logical disks, or NICs the server has in it. More importantly, w2kperf.pl can automatically create the cacti DIS, DS & graphs for you. The one drawback? Because the script uses WMI to collect the data it can only be run from a Windows installation of cacti.

The other scripts should be more portable. The network discovery tool, discover.pl, uses SNMP & WMI (which can be disabled) to locate active IP addresses on your network and provides an educated guess as to what kind of device (Windows server, NetWare server, Linux server, HP printer, switch, router, etc) they are. This allows you to setup monitoring & graphing in minutes using the supplied scripts. Th discovery tool can be integrated right into the Cacti 0.6.8a menu if you so desire.

Printer.pl collects page count and interface stats from networked printers.

Switch.pl collects ifEntry and RMON etherStats for all ports (and VLANs) on a managed switch. The RMON graphs show packet size distribution and the different types of ethernet errors: CRC errors, fragments, jabbers, etc.

Finally, there are a handful of useful utilities included in the download. Some batch files, some SQL queries, some more perl scripts.

Coming soon: Linux servers, APC UPS, NetWare servers, and routers.


Last edited by jlancaster on Fri Mar 21, 2003 3:11 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 15, 2003 12:28 pm 
Offline

Joined: Tue Mar 11, 2003 3:28 pm
Posts: 5
thanks dude! People may have more luck going into the pub dir though..

ftp://216.62.51.106/pub/cacti-ext.zip


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 15, 2003 6:18 pm 
Offline

Joined: Tue Feb 04, 2003 12:05 pm
Posts: 38
Location: Dallas, TX
Thanks! I fixed the link in my original post.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 18, 2003 11:14 am 
Offline
User avatar

Joined: Tue Mar 19, 2002 7:00 pm
Posts: 40
Location: Ann Arbor, MI
Jim, very nicely put together script. But I have ran into a little issue, one of my servers is returning the following:

Quote:
Print results for siweb01:

Computername => SIWEB01
0 => Descr => CPU0
0 => PercentCPULoad => 0
Memory => BytesFreeMem => 1009643520
Memory => BytesFreePageFile => 3058872320
Memory => BytesFreeVirtMem => 4068515840
Memory => PercentFreeMem => 75
Memory => PercentFreePageFile => 95
Memory => PercentFreeVirtMem => 1604
Memory => TotalPageFileSpace => 3206967296
Memory => TotalPhysicalMemory => 1341685760
Memory => TotalVirtualMemory => 253685760
0 => BytesFreeDisk => 4327505408
0 => Descr => C:
0 => PercentFreeDisk => 50
0 => Size => 8589786624

Results for siweb01 complete.


I don't know why it is coming back with such a high percentage, this is a Window 2003 RC 2 box. I have 2 other Windows 2003 RC 2 boxes that return valid data.

Have you tried working with .8 yet? .8 would make this script alot easier.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 18, 2003 4:20 pm 
Offline

Joined: Tue Feb 04, 2003 12:05 pm
Posts: 38
Location: Dallas, TX
Thanks for the feedback. Your results are interesting. I don't have any W2K3 boxes that I can use for testing, so I'm not sure if the problem is specific to that version of Windows.

I'm using pretty basic WMI calls to get the Virtual Memory counters. Have you tried using the WMI Object Browser that is part of WMITools.exe to look at the counters directly? (If not, it is a free download from Microsoft's website.) In W2K and NT4, virtual memory just the sum of physical memory and the pagefile. I use it principally as a check figure. I would be very interested in hearing what you discover via the WMI Object Browser.

I have seen another problem in my testing that is kind of strange. One of the SNMP interface stats comes back as a negative number on one of my servers. It is incrementing correctly as new traffic crosses the interface, i.e., the negative number is growing smaller. I'm not sure what to make of it. The negative counter sure plays hell with the graph. According the the RFC, a negative number is not possible.

As to v0.8, I'm still trying to get it up and running on a Windows box. No success so far, but I'm working with raX to fix it. Once I get it working, I'll begin modifying my scripts to work with the new version.

BTW, did you install the new "Discover" menu item? I'm curious to see how that will work for the cacti community.

Jim


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 18, 2003 4:54 pm 
Offline
User avatar

Joined: Tue Mar 19, 2002 7:00 pm
Posts: 40
Location: Ann Arbor, MI
Quote:
FreeVirtualMemory: 3894804
TotalVirtualMemorySize: 4442044


I have not tried the Discover feature yet, but plan on doing so.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 18, 2003 8:23 pm 
Offline

Joined: Tue Feb 04, 2003 12:05 pm
Posts: 38
Location: Dallas, TX
Check the ftp link for the latest update. I just completed a big revision (although I don't think I've done anything that would address the VM problem you are having.)

I've also added a new script:
switch.pl - SNMP Interface/RMON Performance reporting

All of the other perl scripts had to be revised to accommodate the changes introduced by switch.pl. If you haven't installed the cacti-ext.sql, hold off until you download this update. I modified the query slightly to add a new field to the discover_hosts table.

There are a variety of other useful additions and an updated readme.txt that explains the update in more detail.

Jim


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 21, 2003 6:00 am 
Offline

Joined: Sun May 19, 2002 6:40 pm
Posts: 3
DAMN.. i was so excited when i read this the first time.. then i download and install... to find out it has to RUN FROM Windows.. argh..


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 21, 2003 8:20 am 
Offline

Joined: Mon Mar 10, 2003 8:47 am
Posts: 1
Hi Brunis !

The script relies heavily on WMI (Windows Management Instrumentation) in some modules, which is only available on the Windows platform (preinstalled from W2K and up) -> though is a lot of these values available as performance counters too, which can be made available via the SNMP interface (jlancaster uses this too...)

But maybe jlancaster should make a remark regarding the OS Requirement on the first post... :wink:

BTW. Very, very nice work, jlancaster ! :D

\Fraefel


Last edited by fraefel on Fri Mar 21, 2003 11:35 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Problem Solved
PostPosted: Fri Mar 21, 2003 8:55 am 
Offline
User avatar

Joined: Tue Mar 19, 2002 7:00 pm
Posts: 40
Location: Ann Arbor, MI
I just needed to up the RRD Max Value field. :lol:


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 21, 2003 2:51 pm 
Offline

Joined: Tue Feb 04, 2003 12:05 pm
Posts: 38
Location: Dallas, TX
Thanks for the feedback. I've just posted (yet) another revision the scripts--mostly few bug fixes. I discovered in testing that not all ifEntry stats have corresponding RMON stats. I made an adjustment so that if RMON isn't available for a port, the script will create an ifEntry poll only.

I also had to adjust my printer.pl script for those printers that don't support the MIB2 printer standard. Now, the printer.pl script will pull page count (if there) and ifEntry stats correctly.

I'm sorry I buried the Windows requirement in the readme. It should apply only to the w2kperf.pl script because I'm using WMI to gather the data. The use of WMI in the discover.pl script can be turned off with a '-w' parameter. I'll edit my original post to prevent future confusion.

My testing with WMI has left me somewhat uneasy. It doesn't appear to be as reliable as SNMP. I use GetIf to reivew the MIBs for interesting data, then compare it to what WMI provides. In some cases I've found dramatic differences in counter values and I have no idea why. In a future revision of these extensions I will look into porting w2kperf.pl over to SNMP. This would have the obvious benefit of making the scripts more universal.

Linux server performance stats is next on my list, followed by APC UPS, then perhaps NetWare. Linux should be ready in a week or so, with the others to follow some time after.

Finally, I will be working on a reporting system. My intention is to create a system that will allow you to specify a date range, then generate templated HTML reports in from the RRDTool datafiles. We need this for reporting to our clients on a quarterly basis. I'm sure others of you out there would like the same thing. I've promised my staff to have a working draft in a couple of weeks, with distributable code by the end of April. We'll see.

What I really need from the cacti community is suggestions on graph formats. Things like what information should be combined on the different graphs, presentation format (line or area graphs, color schemes, etc.), and even short explanatory verbiage on what the graphs mean that I can include in the HTML reports.

Thanks again for the feedback.

Enjoy!

Jim


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 30, 2003 10:21 am 
Offline

Joined: Wed Apr 30, 2003 10:15 am
Posts: 3
jlancaster wrote:

....

I've also added a new script:
switch.pl - SNMP Interface/RMON Performance reporting
....

Jim


Hi there, i must commend you on your nice scripts.

i am having one little problem with the switch.pl script tho.

im trying to use that script on a bunch of alcatel switches an Omnis 9s/r and a whole stack of Omnistack 4024G switches.

the problem i have is that the IfDescr in the switches contains Spaces

which means that nothing will work because the .rra files may not contain space.

now im not a programmer at all. my question to you is. what do i need to add to the script.pl file so it edits out the spaces or replaces it with a dash or someother karacter that is allowed.

here is an example
CANNOT FIND DATA SOURCE: c:/apache/htdocs/cacti/rra/mer1-sw24-1-10/100mb ethernet csma/cd interface.rrd

[/Edit]

i replaced IfDescr for ifNumber so it would take the interfacenumber (its what i wanted in the first place) but this screws the Graph hirarchy up. in a really bad way.

[/Edit]


Top
 Profile  
 
 Post subject: problems with perl modules (missing)
PostPosted: Fri May 09, 2003 9:34 am 
I hav problems with DBI.pm and NET/SNMP.pm modules.
They could not be found:(


Sample::
Can't locate DBI.pm in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .) at w2kperf.pl line 133.
BEGIN failed--compilation aborted at w2kperf.pl line 133.


Where can I found these modules?


Top
  
 
 Post subject:
PostPosted: Sat May 24, 2003 10:24 am 
Offline

Joined: Tue Feb 04, 2003 12:05 pm
Posts: 38
Location: Dallas, TX
Are you using version 5.8 of Perl? I don't think the DBI module is available for it yet.

Jim


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 02, 2003 7:30 am 
Any update about the conversion to version 0.8?


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

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 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