blob: 5ed473ba1261edb324e063ce73e1fc97314bbc00 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
#!/bin/sh
#
# Plugin to monitor the number of open files in the system.
#
# Parameters:
#
# config (required)
# autoconf (optional - used by munin-config)
#
# $Log: open_files.in,v $
# Revision 1.1.1.1 2006/06/04 20:53:57 he
# Import the client version of the Munin system monitoring/graphing
# tool -- project homepage is at http://munin.sourceforge.net/
#
# This package has added support for NetBSD, via a number of new plugin
# scripts where specific steps needs to be taken to collect information.
#
# I also modified the ntp_ plugin script to make it possible to not
# plot the NTP poll delay, leaving just jitter and offset, which IMO
# produces a more telling graph.
#
#
#
#
# Magic markers (Used by munin-config and some installation scripts.
# Optional):
#
#%# family=auto
#%# capabilities=autoconf
if [ "$1" = "autoconf" ]; then
if [ -x /usr/sbin/pstat ]; then
/usr/sbin/pstat -T | grep files > /dev/null
if [ $? = "0" ]; then
echo yes
exit 0
else
echo no
exit 1
fi
else
echo no
exit 1
fi
fi
eval `/usr/sbin/pstat -T | awk '/files/ {
split($1, a, "/");
print "filemax=" a[2];
print "openfiles=" a[1];
}'`
if [ "$1" = "config" ]; then
echo 'graph_title File table usage'
echo 'graph_args --base 1000 -l 0'
echo 'graph_vlabel number of open files'
echo 'graph_category system'
echo 'graph_info This graph monitors the Linux open files table.'
echo 'used.label open files'
echo 'used.info The number of currently open files.'
echo 'max.label max open files'
echo 'max.info The maximum supported number of open files.'
awk -v filemax=$filemax '{
printf "used.warning %d\n", $filemax * 0.92;
printf "used.critical %d\n", $filemax * 0.98;
}'
exit 0
fi
echo 'max.value ' $filemax
echo 'used.value ' $openfiles
|