Updated 05/2012: Graph Sockets Pipes and FIles

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

Moderators: Developers, Moderators

Post Reply
scottevil
Posts: 24
Joined: Tue Nov 28, 2006 6:44 am
Location: Akron
Contact:

Updated 05/2012: Graph Sockets Pipes and FIles

Post by scottevil »

Since everything in Linux/Unix is a file, Linux has some interesting ways to monitor for problems. Often systems administrators monitor CPU, Ram, Disk Space, and Network Usage. These are all valid data points and are especially useful for capacity planning. For real time detection of problems, especially with web/application/databases, these are not always the best indicators. In my experience, checking and trending the number of open sockets, pipes, files, tcp/udp sockets, and unix sockets has been the single best indicator of a problem. These have been much better than CPU, Load, or I/O Wait. In fact, under optimal usage of server hardware, one would expect spikes in CPU, RAM, and I/O.

Instructions: http://crunchtools.com/software/cruncht ... pes-files/
Versioned Code: http://code.google.com/p/crunchtools/so ... ipes_files
Attachments
sockets_pipes_files.tgz
(112.34 KiB) Downloaded 349 times
Last edited by scottevil on Fri Apr 12, 2013 9:50 pm, edited 7 times in total.
Scott McCarty
Solutions Architect/Open Source Evangelist
Twitter: @fatherlinux
URL: http://crunchtools.com
User avatar
Linegod
Developer
Posts: 1626
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

Re: Graph Sockets Pipes and FIles

Post by Linegod »

--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
spackler
Posts: 1
Joined: Wed Jan 05, 2011 2:32 pm

Re: Graph Sockets Pipes and FIles

Post by spackler »

The sh/exec functionality appears to have been removed from the ubuntu distributions in favor of keyword extend. Extend also isn't a drop in replacement, the OID's get fairly screwy and the trick of executing the netstat calls in the background no longer works which can hang cacti.

These two threads go into greater detail.
http://www.mail-archive.com/net-snmp-us ... 14895.html
http://www.mail-archive.com/net-snmp-us ... 14731.html
User avatar
Linegod
Developer
Posts: 1626
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

Re: Graph Sockets Pipes and FIles

Post by Linegod »

spackler wrote:The sh/exec functionality appears to have been removed from the ubuntu distributions in favor of keyword extend.
Nothing to do with Ubuntu. net-snmp deprecated exec some time ago.
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
scottevil
Posts: 24
Joined: Tue Nov 28, 2006 6:44 am
Location: Akron
Contact:

Re: Graph Sockets Pipes and FIles

Post by scottevil »

spackler wrote:The sh/exec functionality appears to have been removed from the ubuntu distributions in favor of keyword extend. Extend also isn't a drop in replacement, the OID's get fairly screwy and the trick of executing the netstat calls in the background no longer works which can hang cacti.

These two threads go into greater detail.
http://www.mail-archive.com/net-snmp-us ... 14895.html
http://www.mail-archive.com/net-snmp-us ... 14731.html
Yeah, I knew this was coming because I had tested in fedora with newer versions of net-snmpd and it was complaining. I looked at the fix a while back and you are correct, it is a bit screwy to say the least. I will mess with it and update it.

Scott M
Scott McCarty
Solutions Architect/Open Source Evangelist
Twitter: @fatherlinux
URL: http://crunchtools.com
scottevil
Posts: 24
Joined: Tue Nov 28, 2006 6:44 am
Location: Akron
Contact:

Re: Updated 05/2012: Graph Sockets Pipes and FIles

Post by scottevil »

Alright, I finally updated this to work despite the deprecated sh/exec directive. It was actually quite hilarious that one can code around this problem by using a C or Perl AgentX module. I used an embedded version of the perl module so the configuration is almost exactly as easy as before. It is one directive, one server side file, and one client side file.
Scott McCarty
Solutions Architect/Open Source Evangelist
Twitter: @fatherlinux
URL: http://crunchtools.com
WooLaf
Posts: 7
Joined: Thu Jul 24, 2014 3:55 pm

Re: Updated 05/2012: Graph Sockets Pipes and FIles

Post by WooLaf »

This project looks very interesting. I notice there are client and server scripts, since I only need to monitor a local server I will try to make it work. Does anyone test this on localhost?
scottevil
Posts: 24
Joined: Tue Nov 28, 2006 6:44 am
Location: Akron
Contact:

Re: Updated 05/2012: Graph Sockets Pipes and FIles

Post by scottevil »

I have used it on localhost through snmp, but you could probably tweak it to work with the scripts only.
Scott McCarty
Solutions Architect/Open Source Evangelist
Twitter: @fatherlinux
URL: http://crunchtools.com
PeterPalm
Posts: 1
Joined: Tue Feb 10, 2015 8:18 am

Re: Updated 05/2012: Graph Sockets Pipes and FIles

Post by PeterPalm »

$tmp is not yet used while reading the files, it still uses /var/lib/net-snmp.
mase2hot
Posts: 17
Joined: Wed Sep 23, 2015 8:58 am

Re: Updated 05/2012: Graph Sockets Pipes and FIles

Post by mase2hot »

I get the following error when trying to run this script.

Can't call method "register" on an undefined value at /etc/snmp/spf.pl line 97.
Wirthmueller
Cacti User
Posts: 60
Joined: Wed Mar 02, 2011 9:02 am

Re: Updated 05/2012: Graph Sockets Pipes and FIles

Post by Wirthmueller »

I tried to install these templates - unfortunately the spf.pl script gives the following error:

Code: Select all

Can't locate NetSNMP/agent.pm in @INC (you may need to install the NetSNMP::agent module) (@INC contains: /etc/perl /usr/local/lib/i386-linux-gnu/perl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/i386-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/i386-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/i386-linux-gnu/perl-base) at spf.pl line 26.
BEGIN failed--compilation aborted at spf.pl line 26.
Any help to this?
netniV
Cacti Guru User
Posts: 3440
Joined: Sun Aug 27, 2017 12:05 am

Re: Updated 05/2012: Graph Sockets Pipes and FIles

Post by netniV »

Do you have the NetSNMP devel libraries install? I suspect that's what you'll need for Perl to link into it.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests