From 33ae668a641280b8b756ce94ed401f020ab4cfc5 Mon Sep 17 00:00:00 2001 From: tez Date: Tue, 22 Nov 2011 22:23:13 +0000 Subject: Cacti is a complete frontend to rrdtool, it stores all of the necessary information to create graphs and populates them with data in a MySQL database. The frontend is completely PHP driven. Along with being able to maintain Graphs, Data Sources, and Round Robin Archives in a database, cacti handles the data gathering also. There is also SNMP support for those used to creating traffic graphs with MRTG. The Plugin Architecture for Cacti was designed to be both simple in nature and robust enough to allow freedom to do almost anything in Cacti. The Plugin Architecture for Cacti is integrated into this package. (created from wip/cacti by pettai) --- net/cacti/files/freebsd_memory.pl | 23 +++++++++++++++++++++++ net/cacti/files/httpd-cacti.conf | 21 +++++++++++++++++++++ net/cacti/files/netbsd_memory.pl | 23 +++++++++++++++++++++++ net/cacti/files/solaris_memory.pl | 23 +++++++++++++++++++++++ 4 files changed, 90 insertions(+) create mode 100644 net/cacti/files/freebsd_memory.pl create mode 100644 net/cacti/files/httpd-cacti.conf create mode 100644 net/cacti/files/netbsd_memory.pl create mode 100644 net/cacti/files/solaris_memory.pl (limited to 'net/cacti/files') 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 () { + if (!/^Device/) { + split(); + $s += $_[3]; + } + } + print "$s"; +} +else { # $ARGV[0] is Buffers:, MemFree:, or anything else + open(PROCESS, "vmstat -H |"); + while () { + 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 + + LoadModule php@PKG_PHP_MAJOR_VERS@_module lib/httpd/mod_php@PKG_PHP_MAJOR_VERS@.so + + +Alias /cacti "@CACTIDIR@" + + + Options None + AllowOverride Limit + AddHandler application/x-httpd-php .php + DirectoryIndex index.php + Order allow,deny + Allow from all + + +# some people prefer a simple URL like http://cacti.example.com +# +# DocumentRoot @CACTIDIR@ +# ServerName cacti.example.com +# 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 () { + if (!/^Device/) { + split(); + $s += $_[3]; + } + } + print "$s"; +} +else { # $ARGV[0] is Buffers:, MemFree:, or anything else + open(PROCESS, "vmstat |"); + while () { + 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 () { + if (!/^Device/) { + split(); + $s += $_[3]; + } + } + print "$s"; +} +else { # $ARGV[0] is Buffers:, MemFree:, or anything else + open(PROCESS, "vmstat |"); + while () { + if (!/p/) { # the numbers line happens not to have "p" + split(); + print("$_[4]"); + } + } +} +close(PROCESS); -- cgit v1.2.3