Open Files script

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

Moderators: Developers, Moderators

Post Reply
GrandMasterLee
Posts: 17
Joined: Tue Jul 23, 2002 5:53 pm
Contact:

Open Files script

Post by GrandMasterLee »

Here is the open-files script I hacked out for cacti. It could be trimmed down a bit, but I just took load_avg.pl and now I've got max-files.pl

Code: Select all

#!/usr/bin/perl
#This is max-files.pl

#get load avg for 5;15;30 min
$avg = `cat /proc/sys/fs/file-nr`;
$avg =~ s/.*://;
chomp $avg;
$avg =~ s/\t/ /g;

print $avg;

TIA.

--The GrandMaster
dbenders
Posts: 28
Joined: Mon Oct 14, 2002 2:02 pm
Location: Santiago, CHILE

Can you explain what the output is?

Post by dbenders »

Hi, can you please explain what is the output?

current open files?
User avatar
ablyler
Posts: 40
Joined: Tue Mar 19, 2002 7:00 pm
Location: Ann Arbor, MI
Contact:

Post by ablyler »

It is the number of files that are currenly opened by the IO of the kernel. This comes in to play in very large enviroments, but is also very cool just to look at. :lol:
dbenders
Posts: 28
Joined: Mon Oct 14, 2002 2:02 pm
Location: Santiago, CHILE

Sound great! Is there a SNMP way to get that info?

Post by dbenders »

I have some linux boxes, is there a SNMP OID to get that info?
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests