Update to 1.0.0, and adds support for php7.

PR:		216801
Submitted by:	maintainer
This commit is contained in:
Vanilla I. Shu 2017-02-10 15:50:53 +00:00
parent ea24070175
commit c187b3a72d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=433809
13 changed files with 916 additions and 275 deletions

View file

@ -1,7 +1,7 @@
# $FreeBSD$
PORTNAME= cacti
PORTVERSION= 0.8.8h${PATCHLEVEL}
PORTVERSION= 1.0.1
CATEGORIES= net-mgmt www
MASTER_SITES= http://www.cacti.net/downloads/ \
ftp://ftpmirror.uk/freebsd-ports/cacti/
@ -14,9 +14,8 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
RUN_DEPENDS= rrdtool:databases/rrdtool
USES= cpe mysql shebangfix
USE_PHP= mysqli pcre session sockets snmp xml
WANT_PHP_WEB= yes
USES= cpe mysql php:web shebangfix
USE_PHP= ctype filter gd gmp hash json ldap mbstring openssl pcre pdo pdo_mysql posix session simplexml sockets snmp xml zlib
NO_ARCH= yes
NO_BUILD= yes
PKGMESSAGE= ${WRKDIR}/pkg-message

View file

@ -1,2 +1,3 @@
SHA256 (cacti-0.8.8h.tar.gz) = 0673bd9513dad381c8bbb9133c721a32bc6422dc91c5a81de16e3cd32e4d0600
SIZE (cacti-0.8.8h.tar.gz) = 2585226
TIMESTAMP = 1486494702
SHA256 (cacti-1.0.1.tar.gz) = cc36b83653cecd2be0a4a239927dcdaafeb81e7fd7ad6f97c664edcb7fb07628
SIZE (cacti-1.0.1.tar.gz) = 7230227

View file

@ -1,11 +1,11 @@
--- include/global.php.bak 2015-03-12 03:07:05.768314249 -0700
+++ include/global.php 2015-03-12 03:08:04.171320391 -0700
@@ -113,7 +113,7 @@
$config["library_path"] = preg_replace("/(.*[\/])include/", "\\1lib", dirname(__FILE__));
--- include/global.php.orig 2017-02-04 14:12:12.747287000 +0000
+++ include/global.php 2017-02-04 14:12:32.931726000 +0000
@@ -126,7 +126,7 @@
$config['library_path'] = preg_replace("/(.*[\/])include/", "\\1lib", dirname(__FILE__));
}
$config["include_path"] = dirname(__FILE__);
-$config["rra_path"] = $config["base_path"] . '/rra';
+$config["rra_path"] = '/var/db/cacti/rra';
$config['include_path'] = dirname(__FILE__);
-$config['rra_path'] = $config['base_path'] . '/rra';
+$config['rra_path'] = '/var/db/cacti/rra';
/* colors */
$colors["dark_outline"] = "454E53";
/* for multiple pollers, we need to know this location */
if (!isset($scripts_path)) {

View file

@ -1,11 +1,14 @@
--- include/global_settings.php.bak 2015-03-12 03:08:59.333297709 -0700
+++ include/global_settings.php 2015-03-12 03:10:47.532302704 -0700
@@ -96,7 +96,7 @@
--- include/global_settings.php.orig 2017-02-04 14:13:42.140386000 +0000
+++ include/global_settings.php 2017-02-04 14:20:35.592474000 +0000
@@ -135,9 +135,9 @@
),
"path_cactilog" => array(
"friendly_name" => "Cacti Log File Path",
- "description" => "The path to your Cacti log file (if blank, defaults to <path_cacti>/log/cacti.log)",
+ "description" => "The path to your Cacti log file (if blank, defaults to /var/log/cacti/log)",
"method" => "filepath",
"default" => $config["base_path"] . "/log/cacti.log",
"max_length" => "255"
'path_cactilog' => array(
'friendly_name' => __('Cacti Log Path'),
- 'description' => __('The path to your Cacti log file (if blank, defaults to <path_cacti>/log/cacti.log)'),
+ 'description' => __('The path to your Cacti log file (if blank, defaults to /var/log/cacti/log)'),
'method' => 'filepath',
- 'default' => $config['base_path'] . '/log/cacti.log',
+ 'default' => '/var/log/cacti/log',
'max_length' => '255'
),
'logrotate_enabled' => array(

View file

@ -0,0 +1,11 @@
--- install/functions.php.orig 2017-02-04 14:21:02.093580000 +0000
+++ install/functions.php 2017-02-04 14:21:31.615575000 +0000
@@ -365,7 +365,7 @@
if (config_value_exists('path_cactilog')) {
$input['path_cactilog']['default'] = read_config_option('path_cactilog');
} else {
- $input['path_cactilog']['default'] = $config['base_path'] . '/log/cacti.log';
+ $input['path_cactilog']['default'] = '/var/log/cacti/log';
}
/* Theme */

View file

@ -1,20 +0,0 @@
--- install/index.php.orig 2016-05-28 10:54:08.124059773 +0100
+++ install/index.php 2016-05-28 10:54:34.252057818 +0100
@@ -63,7 +63,7 @@
}
function verify_php_extensions() {
- $extensions = array("session", "sockets", "mysql", "xml");
+ $extensions = array("session", "sockets", "mysqli", "xml");
$ok = true;
$missing_extension = " <p style='font-family: Verdana, Arial; font-size: 16px; font-weight: bold; color: red;'>Error</p>
<p style='font-family: Verdana, Arial; font-size: 12px;'>The following PHP extensions are missing:</p><ul>";
@@ -267,7 +267,7 @@
if (config_value_exists("path_cactilog")) {
$input["path_cactilog"]["default"] = read_config_option("path_cactilog");
} else {
- $input["path_cactilog"]["default"] = $config["base_path"] . "/log/cacti.log";
+ $input["path_cactilog"]["default"] = "/var/log/cacti/log";
}
/* SNMP Version */

View file

@ -0,0 +1,20 @@
--- lib/clog_webapi.php.orig 2017-02-04 14:22:42.713430000 +0000
+++ lib/clog_webapi.php 2017-02-04 14:23:10.949163000 +0000
@@ -40,7 +40,7 @@
$logfile = read_config_option('path_cactilog');
if ($logfile == '') {
- $logfile = $config['base_path'] . '/log/cacti.log';
+ $logfile = '/var/log/cacti/log';
}
if (file_exists($logfile)) {
@@ -64,7 +64,7 @@
$logfile = read_config_option('path_cactilog');
if ($logfile == '') {
- $logfile = './log/cacti.log';
+ $logfile = '/var/log/cacti/log';
}
/* helps determine output color */

View file

@ -1,15 +1,11 @@
--- lib/functions.php.orig 2016-05-28 10:58:17.522042409 +0100
+++ lib/functions.php 2016-05-28 11:00:31.399032747 +0100
@@ -670,8 +670,10 @@
$issue_log_message = false;
$ping_failure_count = read_config_option("ping_failure_count");
$ping_recovery_count = read_config_option("ping_recovery_count");
- $hosts[$host_id]["status_fail_date"] = '0000-00-00 00:00:00';
- $hosts[$host_id]["status_rec_date"] = '0000-00-00 00:00:00';
+ if ((!isset($hosts[$host_id]["status_fail_date"])) || ($hosts[$host_id]["status_fail_date"] == ""))
+ $hosts[$host_id]["status_fail_date"] = '0000-00-00 00:00:00';
+ if ((!isset($hosts[$host_id]["status_rec_date"])) || ($hosts[$host_id]["status_rec_date"] == ""))
+ $hosts[$host_id]["status_rec_date"] = '0000-00-00 00:00:00';
--- lib/functions.php.orig 2017-02-04 14:16:43.886716000 +0000
+++ lib/functions.php 2017-02-04 14:22:18.219392000 +0000
@@ -649,7 +649,7 @@
/* Log to Logfile */
if ((($logdestination == 1) || ($logdestination == 2)) && (read_config_option('log_verbosity') != POLLER_VERBOSITY_NONE)) {
if ($logfile == '') {
- $logfile = $config['base_path'] . '/log/cacti.log';
+ $logfile = '/var/log/cacti/log';
}
if ($status == HOST_DOWN) {
/* update total polls, failed polls and availability */
/* echo the data to the log (append) */

View file

@ -0,0 +1,15 @@
--- poller_maintenance.php.orig 2017-02-04 14:23:37.951265000 +0000
+++ poller_maintenance.php 2017-02-04 14:24:49.403929000 +0000
@@ -172,10 +172,10 @@
*/
function logrotate_rotatenow () {
global $config;
- $log = $config['base_path'] . '/log/cacti.log';
+ $log = '/var/log/cacti/log';
set_config_option('logrotate_lastrun', time());
clearstatcache();
- if (is_writable($config['base_path'] . '/log/') && is_writable($log)) {
+ if (is_writable('/var/log/cacti') && is_writable($log)) {
$perms = octdec(substr(decoct( fileperms($log) ), 2));
$owner = fileowner($log);
$group = filegroup($log);

View file

@ -1,11 +0,0 @@
--- ./scripts/ping.pl.orig 2014-08-15 15:39:56.000000000 +0200
+++ ./scripts/ping.pl 2014-08-15 15:40:35.000000000 +0200
@@ -6,7 +6,7 @@
# old linux version use "icmp_seq"
# newer use "icmp_req" instead
-open(PROCESS, "ping -c 1 $host | grep 'icmp_[s|r]eq' | grep time |");
+open(PROCESS, "/sbin/ping -c 1 $host | grep 'icmp_[s|r]eq' | grep time |");
$ping = <PROCESS>;
close(PROCESS);
$ping =~ m/(.*time=)(.*) (ms|usec)/;

View file

@ -0,0 +1,20 @@
--- utilities.php.orig 2017-02-04 14:25:11.346062000 +0000
+++ utilities.php 2017-02-04 14:25:39.435371000 +0000
@@ -869,7 +869,7 @@
$logfile = read_config_option('path_cactilog');
if ($logfile == '') {
- $logfile = $config['base_path'] . '/log/cacti.log';
+ $logfile = '/var/log/cacti/log';
}
/* helps determine output color */
@@ -1149,7 +1149,7 @@
$logfile = read_config_option('path_cactilog');
if ($logfile == '') {
- $logfile = './log/cacti.log';
+ $logfile = '/var/log/cacti/log';
}
html_start_box(__('Clear Cacti Log'), '100%', '', '3', 'center', '');

View file

@ -1,18 +1,22 @@
=======================================================================
Cacti is now installed. If you intall it for the first time,
Cacti is now installed. If you install it for the first time,
you may have to follow this steps to make it work correctly:
1. Create the MySQL database, a cacti user, and initialize:
a) CREATE DATABASE cacti;
a) CREATE DATABASE `cacti`;
b) Create a mysql user/password for cacti:
CREATE USER 'cacti'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
c) Add GRANTS:
GRANT ALL ON cacti.* TO 'cacti'@'localhost';
GRANT ALL ON `cacti`.* TO 'cacti'@'localhost';
GRANT SELECT ON `mysql`.`time_zone_name` TO 'cacti'@'localhost';
FLUSH PRIVILEGES;
d) Import the default cacti database:
mysql --database=cacti -ucacti -p < %%PREFIX%%/%%CACTIDIR%%/cacti.sql
If you haven't already imported your MySQL timezone data, you need to do this:
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql
NOTE:
* Cacti does not LOCK TABLES.
@ -29,8 +33,8 @@ you may have to follow this steps to make it work correctly:
*/5 * * * * %%LOCALBASE%%/bin/php %%PREFIX%%/%%CACTIDIR%%/poller.php > /dev/null 2>&1
4. Example Apache 2.4 configuration:
(This assumes that you have installed a working PHP Apache install, e.g. with mod_php)
LoadModule php5_module libexec/apache22/libphp5.so
<FilesMatch "\.php$">
SetHandler application/x-httpd-php
@ -53,8 +57,8 @@ you may have to follow this steps to make it work correctly:
Allow from all
</Directory>
5. Open a Cacti login page in your web browser and login with
admin/admin.
5. Open a Cacti login page in your web browser and follow the install instructions.
If you update cacti, open a login page and an updating process will
start automatically.
@ -82,6 +86,8 @@ NOTEs as of 10Aug2014:
/usr/local/bin.
Other Erratas:
Mount linprocfs in /compat/linux/proc will alow most scripts to work.
1) Mount linprocfs in /compat/linux/proc will allow most scripts to work.
2) This package does not install a MySQL server in case you wish to use an
external MySQL server. Install a package such as mysql57-server if you
require a local server.
=======================================================================

File diff suppressed because it is too large Load diff