aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/cacti/files
diff options
context:
space:
mode:
authorSergey Matveychuk <sem@FreeBSD.org>2005-04-21 07:02:05 +0000
committerSergey Matveychuk <sem@FreeBSD.org>2005-04-21 07:02:05 +0000
commitbadc83477806938f63e5ca4148aa28390be55edf (patch)
tree5939b81c00b79b52f11286229f9b036793b20e79 /net-mgmt/cacti/files
parent1f69ffcc672f32216231a65421fdb4683cbb5f60 (diff)
downloadports-badc83477806938f63e5ca4148aa28390be55edf.tar.gz
ports-badc83477806938f63e5ca4148aa28390be55edf.zip
Notes
Diffstat (limited to 'net-mgmt/cacti/files')
-rw-r--r--net-mgmt/cacti/files/pkg-install.in50
-rw-r--r--net-mgmt/cacti/files/pkg-message.in21
2 files changed, 71 insertions, 0 deletions
diff --git a/net-mgmt/cacti/files/pkg-install.in b/net-mgmt/cacti/files/pkg-install.in
new file mode 100644
index 000000000000..da76801ae6b9
--- /dev/null
+++ b/net-mgmt/cacti/files/pkg-install.in
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+PW=/usr/sbin/pw
+UID=107
+GID=${UID}
+CACTIUSER=%%CACTIUSER%%
+CACTIGROUP=%%CACTIGROUP%%
+CACTIDIR=%%CACTIDIR%%
+PREFIX=%%PREFIX%%
+
+case $2 in
+
+PRE-INSTALL)
+
+ if ${PW} group show "${CACTIGROUP}" 2>/dev/null; then
+ echo "You already have a group \"${CACTIGROUP}\", so I will use it."
+ else
+ if ${PW} groupadd ${CACTIGROUP} -g ${GID}; then
+ echo "Added group \"${CACTIGROUP}\"."
+ else
+ echo "Adding group \"${CACTIGROUP}\" failed..."
+ exit 1
+ fi
+ fi
+
+ if ${PW} user show "${CACTIUSER}" 2>/dev/null; then
+ echo "You already have a user \"${CACTIUSER}\", so I will use it."
+ else
+ if ${PW} useradd ${CACTIUSER} -u ${UID} -g ${CACTIGROUP} -h - \
+ -d "/nonexistent" -s /sbin/nologin -c "Cacti Sandbox"
+ then
+ echo "Added user \"${CACTIUSER}\"."
+ else
+ echo "Adding user \"${CACTIUSER}\" failed..."
+ exit 1
+ fi
+ fi
+ ;;
+
+POST-INSTALL)
+
+ chown ${CACTIUSER}:${CACTIGROUP} ${PREFIX}/${CACTIDIR}/log/
+ chown ${CACTIUSER}:${CACTIGROUP} ${PREFIX}/${CACTIDIR}/log/*
+ chown ${CACTIUSER}:${CACTIGROUP} ${PREFIX}/${CACTIDIR}/rra/
+ ;;
+*)
+ exit 1
+;;
+esac
+exit
diff --git a/net-mgmt/cacti/files/pkg-message.in b/net-mgmt/cacti/files/pkg-message.in
new file mode 100644
index 000000000000..f2df9ffd151e
--- /dev/null
+++ b/net-mgmt/cacti/files/pkg-message.in
@@ -0,0 +1,21 @@
+==================================================================
+Cacti is now installed. You may have to follow this steps
+to make it work correctly.
+
+1: Create the MySQL database
+# mysqladmin --user=root create cacti
+2: Create a mysql user/password for cacti
+(change user and/or password if requered)
+# echo "GRANT ALL ON cacti.* TO cactiuser at localhost IDENTIFIED BY 'cactiuser'; FLUSH PRIVILEGES;" | mysql &&
+3: Import the default cacti database
+# mysql cacti < %%PREFIX%%/%%CACTIDIR%%/cacti.sql
+4: Edit include/config.php
+Specify the MySQL user, password and database for your cacti configuration.
+5: Add a line to your /etc/crontab file similar to:
+*/5 * * * * %%CACTIUSER%% %%LOCALBASE%%/bin/php %%PREFIX%%/%%CACTIDIR%%/poller.php > /dev/null 2>&1
+6: Add alias in apache config for the cacti dir
+Alias /cacti "%%PREFIX%%/%%CACTIDIR%%/"
+7: Open cacti login page in your web browser and login with admin/admin
+
+Have fun!
+==================================================================