summaryrefslogtreecommitdiff
path: root/net/cacti/files
diff options
context:
space:
mode:
authortez <tez>2011-11-22 22:23:13 +0000
committertez <tez>2011-11-22 22:23:13 +0000
commit33ae668a641280b8b756ce94ed401f020ab4cfc5 (patch)
tree757688bfa4b7c1c71b3b9209004b569722145cc8 /net/cacti/files
parenta623a0acf3018468f3fd13be96a380d2359b67cc (diff)
downloadpkgsrc-33ae668a641280b8b756ce94ed401f020ab4cfc5.tar.gz
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)
Diffstat (limited to 'net/cacti/files')
-rw-r--r--net/cacti/files/freebsd_memory.pl23
-rw-r--r--net/cacti/files/httpd-cacti.conf21
-rw-r--r--net/cacti/files/netbsd_memory.pl23
-rw-r--r--net/cacti/files/solaris_memory.pl23
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);