diff options
Diffstat (limited to 'net/cacti/files')
-rw-r--r-- | net/cacti/files/freebsd_memory.pl | 23 | ||||
-rw-r--r-- | net/cacti/files/httpd-cacti.conf | 21 | ||||
-rw-r--r-- | net/cacti/files/netbsd_memory.pl | 23 | ||||
-rw-r--r-- | net/cacti/files/solaris_memory.pl | 23 |
4 files changed, 90 insertions, 0 deletions
diff --git a/net/cacti/files/freebsd_memory.pl b/net/cacti/files/freebsd_memory.pl new file mode 100644 index 00000000000..ae8b54c603a --- /dev/null +++ b/net/cacti/files/freebsd_memory.pl @@ -0,0 +1,23 @@ +#!/usr/bin/perl + +if (($ARGV[0] =~ /Cached:/) || ($ARGV[0] =~ /SwapFree:/)) { + open(PROCESS, "pstat -ks |"); + $s = 0; + while (<PROCESS>) { + if (!/^Device/) { + split(); + $s += $_[3]; + } + } + print "$s"; +} +else { # $ARGV[0] is Buffers:, MemFree:, or anything else + open(PROCESS, "vmstat -H |"); + while (<PROCESS>) { + if (!/p/) { # the numbers line happens not to have "p" + split(); + print("$_[4]"); + } + } +} +close(PROCESS); diff --git a/net/cacti/files/httpd-cacti.conf b/net/cacti/files/httpd-cacti.conf new file mode 100644 index 00000000000..aee46091f2b --- /dev/null +++ b/net/cacti/files/httpd-cacti.conf @@ -0,0 +1,21 @@ +# load the php module if it is not already loaded +<IfModule !php@PKG_PHP_MAJOR_VERS@_module> + LoadModule php@PKG_PHP_MAJOR_VERS@_module lib/httpd/mod_php@PKG_PHP_MAJOR_VERS@.so +</IfModule> + +Alias /cacti "@CACTIDIR@" + +<Directory "@CACTIDIR@"> + Options None + AllowOverride Limit + AddHandler application/x-httpd-php .php + DirectoryIndex index.php + Order allow,deny + Allow from all +</Directory> + +# some people prefer a simple URL like http://cacti.example.com +#<VirtualHost 1.2.3.4> +# DocumentRoot @CACTIDIR@ +# ServerName cacti.example.com +#</VirtualHost> diff --git a/net/cacti/files/netbsd_memory.pl b/net/cacti/files/netbsd_memory.pl new file mode 100644 index 00000000000..13befcb45cb --- /dev/null +++ b/net/cacti/files/netbsd_memory.pl @@ -0,0 +1,23 @@ +#!/usr/bin/perl + +if (($ARGV[0] =~ /Cached:/) || ($ARGV[0] =~ /SwapFree:/)) { + open(PROCESS, "pstat -ks |"); + $s = 0; + while (<PROCESS>) { + if (!/^Device/) { + split(); + $s += $_[3]; + } + } + print "$s"; +} +else { # $ARGV[0] is Buffers:, MemFree:, or anything else + open(PROCESS, "vmstat |"); + while (<PROCESS>) { + if (!/p/) { # the numbers line happens not to have "p" + split(); + print("$_[4]"); + } + } +} +close(PROCESS); diff --git a/net/cacti/files/solaris_memory.pl b/net/cacti/files/solaris_memory.pl new file mode 100644 index 00000000000..f956571d8be --- /dev/null +++ b/net/cacti/files/solaris_memory.pl @@ -0,0 +1,23 @@ +#!/usr/bin/perl + +if (($ARGV[0] =~ /Cached:/) || ($ARGV[0] =~ /SwapFree:/)) { + open(PROCESS, "/bin/df -k swap |"); + $s = 0; + while (<PROCESS>) { + if (!/^Device/) { + split(); + $s += $_[3]; + } + } + print "$s"; +} +else { # $ARGV[0] is Buffers:, MemFree:, or anything else + open(PROCESS, "vmstat |"); + while (<PROCESS>) { + if (!/p/) { # the numbers line happens not to have "p" + split(); + print("$_[4]"); + } + } +} +close(PROCESS); |