1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-20 20:09:11 +00:00

Update to 1.65.1

This upgrade disables polling via cronjob.
You must now use the Dispatcher.  See UPDATING
This commit is contained in:
Dan Langille 2020-07-20 21:35:34 +00:00
parent 3c783e2b68
commit aab2a6b0ce
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=542675
13 changed files with 155 additions and 147 deletions

View File

@ -6,6 +6,37 @@ You should get into the habit of checking this file for changes each time
you update your ports collection, before attempting any port upgrades.
20200720:
AFFECTS: users of net-mgmt/librenms
AUTHOR: dvl@FreeBSD.org
As mentioned previously in 20200503 polling via cronjob has been removed as of
release 1.63 - see
https://community.librenms.org/t/dropping-support-for-php-7-1-and-python-2/11851
A database upgrade is required:
cd /usr/local/www/librenms
sudo ./lnms migrate
You must migrate to the Dispatch Service:
https://docs.librenms.org/Extensions/Dispatcher-Service/
You may need to add LIBRENMS_USER to .env (see .env.example).
These steps should get you running:
* comment out the crontab entries listed above under PYPOLLER
* populate %%WWWDIR%%/.env with:
* APP_KEY - see farther below for how to create
* NODE_ID - see just below for how to create
* DB_HOST
* DB_DATABASE
* DB_USERNAME
* DB_PASSWORD
* you can create a NODE_ID with: php -r 'echo uniqid() . "\n";'
* sysrc librenms_enable="YES"
* service librenms start
20200719:
AFFECTS: users of emulators/qemu
AUTHOR: bofh@FreeBSD.org
@ -190,7 +221,7 @@ you update your ports collection, before attempting any port upgrades.
AUTHOR: dvl@FreeBSD.org
Polling via cronjob is deprecated as of release 1.63
see see https://community.librenms.org/t/dropping-support-for-php-7-1-and-python-2/11851
Please see https://community.librenms.org/t/dropping-support-for-php-7-1-and-python-2/11851
Please migrate to the Dispatch Service:
https://docs.librenms.org/Extensions/Dispatcher-Service/

View File

@ -2,8 +2,7 @@
# $FreeBSD$
PORTNAME= librenms
PORTVERSION= 1.63
PORTREVISION= 2
PORTVERSION= 1.65.1
PORTEPOCH= 1
CATEGORIES= net-mgmt
MASTER_SITES= LOCAL/dvl:vendor
@ -14,12 +13,12 @@ COMMENT= Autodiscovering PHP/MySQL/SNMP based network monitoring
LICENSE= GPLv3
USES= shebangfix
USES= shebangfix python
# RELEASE_TIMESTAMP is used for a patch inside the vendor code
# it represents the release date via: git show --pretty='%H|%ct' -s 1.42.01
# It sits here so you remember to update it with each release
RELEASE_TIMESTAMP= 1588045962
RELEASE_TIMESTAMP= 1594410976
# perhaps we also need python-memcache python-mysqldb
RUN_DEPENDS+= rrdtool:databases/rrdtool \
@ -28,7 +27,9 @@ RUN_DEPENDS+= rrdtool:databases/rrdtool \
${LOCALBASE}/share/pear/Net/IPv6.php:net/pear-Net_IPv6@${PHP_FLAVOR} \
snmpget:net-mgmt/net-snmp \
bash:shells/bash \
sudo:security/sudo
sudo:security/sudo \
${PYTHON_PKGNAMEPREFIX}python-dotenv>0:www/py-python-dotenv@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pymysql>0:databases/py-pymysql@${PY_FLAVOR}
USE_PHP= ctype curl dom fileinfo filter gd hash json ldap mbstring \
mysqli openssl pdo pdo_mysql phar posix session simplexml \
@ -46,26 +47,16 @@ NO_BUILD= yes
OPTIONS_DEFINE= FPING IPMITOOL LIBVIRT MYSQLD NAGPLUGINS NMAP WMIC DOCS EXAMPLES X11
OPTIONS_DEFAULT= FPING IPMITOOL LIBVIRT NAGPLUGINS NMAP PYPOLLER WMIC
OPTIONS_SINGLE= POLLERSYSTEM
OPTIONS_SINGLE_POLLERSYSTEM= PYPOLLER PYSERVICE #conflicting python versions
FPING_DESC= Enable fping support ping monitoring
IPMITOOL_DESC= Enable support for monitoring hardware IPMI
MYSQLD_DESC= Use local MySQL server
WMIC_DESC= Enable support for WMI polling
PYPOLLER_DESC= Support for polling using cron entries
PYSERVICE_DESC= Support for polling using a daemon
FPING_RUN_DEPENDS= fping:net/fping
IPMITOOL_RUN_DEPENDS= ipmitool:sysutils/ipmitool
LIBVIRT_RUN_DEPENDS= virsh:devel/libvirt
NAGPLUGINS_RUN_DEPENDS= ${LOCALBASE}/libexec/nagios/check_nagios:net-mgmt/nagios-plugins
NMAP_RUN_DEPENDS= nmap:security/nmap
PYPOLLER_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}MySQLdb>=1.2.3:databases/py-MySQLdb@${PY_FLAVOR}
PYPOLLER_USES= python:2.7
PYSERVICE_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}python-dotenv>0:www/py-python-dotenv@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pymysql>0:databases/py-pymysql@${PY_FLAVOR}
PYSERVICE_USES= python:3.6+
X11_RUN_DEPENDS= Magick-config:graphics/ImageMagick6 \
mtr:net/mtr
X11_RUN_DEPENDS_OFF= Magick-config:graphics/ImageMagick6-nox11 \
@ -75,7 +66,10 @@ WMIC_RUN_DEPENDS= wmic:net-mgmt/wmi-client
MYSQLD_USES= mysql:server
MYSQLD_USES_OFF= mysql:client
SHEBANG_FILES= scripts/auth_test.php scripts/deploy-docs.sh scripts/github-remove \
SHEBANG_FILES= scripts/auth_test.php \
scripts/check_requirements.py \
scripts/deploy-docs.sh \
scripts/github-remove \
scripts/Migration/Standard_Conversion/convert_no_xml.sh \
scripts/Migration/Standard_Conversion/destwork_no_xml.sh \
scripts/Migration/Standard_Conversion/mkdir.sh \
@ -108,8 +102,8 @@ ROOT_FILES= addhost.php adduser.php alerts.php artisan billing-calculate.php \
build-base.php build.sql check-services.php composer.json \
composer.lock config.php.default config_to_json.php cronic daily.php \
delhost.php discovery-wrapper.py discovery.php dist-pollers.php irc.php \
librenms-service.py mkdocs.yml pbin.sh phpunit.xml ping.php poll-billing.php poller.php poller-service.py \
poller-wrapper.py readmegen.yml renamehost.php services-wrapper.py snmp-scan.py \
librenms-service.py mkdocs.yml pbin.sh phpunit.xml ping.php poll-billing.php poller.php \
poller-wrapper.py readmegen.yml renamehost.php snmp-scan.py \
snmptrap.php syslog.php validate.php
SCRIPT_FILES= daily.sh lnms
@ -128,14 +122,6 @@ OTHER_DIRS= html/js/lang \
tests/Browser/screenshots \
vendor/amenadiel/jpgraph/tests/_output \
vendor/amenadiel/jpgraph/tests/_support/_generated \
vendor/laravel/laravel/bootstrap/cache \
vendor/laravel/laravel/storage/app/public \
vendor/laravel/laravel/storage/framework/cache \
vendor/laravel/laravel/storage/framework/cache/data \
vendor/laravel/laravel/storage/framework/sessions \
vendor/laravel/laravel/storage/framework/testing \
vendor/laravel/laravel/storage/framework/views \
vendor/laravel/laravel/storage/logs \
vendor/php-amqplib/php-amqplib/docs
DOCS= AUTHORS.md CHANGELOG.md CONTRIBUTING.md LICENSE.txt README.md
@ -144,12 +130,8 @@ PORTEXAMPLES= snmp.conf.example snmpd.conf.example
NO_ARCH= yes
post-patch:
@${REINPLACE_CMD} 's|%%PORTNAME%%|${PORTNAME}|g' ${WRKSRC}/config.php.default
@${REINPLACE_CMD} 's|%%WWW_USER%%|${WWWOWN}|g' ${WRKSRC}/config.php.default
@${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/poller-wrapper.py ${WRKSRC}/poller.php
@${REINPLACE_CMD} 's|%%PORTVERSION%%|${PORTVERSION}|g' ${WRKSRC}/includes/common.php
@${REINPLACE_CMD} 's|%%RELEASE_TIMESTAMP%%|${RELEASE_TIMESTAMP}|g' ${WRKSRC}/includes/common.php
@${REINPLACE_CMD} -e 's|/opt/librenms|${WWWDIR}|' ${WRKSRC}/html/install.php
@${RM} ${WRKSRC}/LibreNMS/Validations/Updates.php
do-install:

View File

@ -1,5 +1,5 @@
TIMESTAMP = 1588252287
SHA256 (librenms-vendor-1.63.tar.gz) = 4c6bd2ad777d14752c7fe1ba22bae09079dd5d2f75dcfcfb48d7e42c804521e7
SIZE (librenms-vendor-1.63.tar.gz) = 27496021
SHA256 (librenms-librenms-1.63_GH0.tar.gz) = ac114391958327893013ed8e2e23aeef3f384a398d1fd2347aee91e2689eed43
SIZE (librenms-librenms-1.63_GH0.tar.gz) = 43790047
TIMESTAMP = 1595266936
SHA256 (librenms-vendor-1.65.1.tar.gz) = 50419db248edc3aad935bc13d7ca5a98e7a862a0221cd12a6b06dc300a557c00
SIZE (librenms-vendor-1.65.1.tar.gz) = 27458132
SHA256 (librenms-librenms-1.65.1_GH0.tar.gz) = 31824ca00bf503d661fb1646448db08b0c5bd8361f2163fae1e31b0bd29c1a11
SIZE (librenms-librenms-1.65.1_GH0.tar.gz) = 45656920

View File

@ -0,0 +1,11 @@
--- LibreNMS/Util/Version.php.orig 2020-07-20 20:50:27 UTC
+++ LibreNMS/Util/Version.php
@@ -92,7 +92,7 @@ class Version
public static function python()
{
- $proc = new Process(['python3', '--version']);
+ $proc = new Process(['/usr/local/bin/python3', '--version']);
$proc->run();
if ($proc->getExitCode() !== 0) {

View File

@ -0,0 +1,29 @@
--- LibreNMS/Validations/Php.php.orig 2020-07-20 21:19:29 UTC
+++ LibreNMS/Validations/Php.php
@@ -56,7 +56,7 @@ class Php extends BaseValidation
}
$web_version = PHP_VERSION;
- $cli_version = rtrim(shell_exec('php -r "echo PHP_VERSION;"'));
+ $cli_version = rtrim(shell_exec('/usr/local/bin/php -r "echo PHP_VERSION;"'));
if (version_compare($web_version, $cli_version, '!=')) {
$validator->fail("PHP version of your webserver ($web_version) does not match the cli version ($cli_version)", "If you updated PHP recently, restart php-fpm or apache to switch to the new version");
}
@@ -120,7 +120,7 @@ class Php extends BaseValidation
$ini_tz = ini_get('date.timezone');
$sh_tz = rtrim(shell_exec('date +%Z'));
$php_tz = date('T');
- $php_cli_tz = rtrim(shell_exec('php -r "echo date(\'T\');"'));
+ $php_cli_tz = rtrim(shell_exec('/usr/local/bin/php -r "echo date(\'T\');"'));
if (empty($ini_tz)) {
// make sure timezone is set
@@ -139,7 +139,7 @@ class Php extends BaseValidation
// check if web and cli timezones match (this does nothing if validate.php is run on cli)
// some distros have different php.ini for cli and the web server
if ($sh_tz !== $php_cli_tz) {
- $ini_file = rtrim(shell_exec('php -r "echo php_ini_loaded_file();"'));
+ $ini_file = rtrim(shell_exec('/usr/local/bin/php -r "echo php_ini_loaded_file();"'));
$validator->fail(
"The CLI php.ini ($php_cli_tz) timezone is different than your system's timezone ($sh_tz)",
"Edit your CLI ini file $ini_file and set the correct timezone ($sh_tz)."

View File

@ -1,10 +1,10 @@
--- LibreNMS/Validations/Programs.php.orig 2020-04-28 03:52:42 UTC
--- LibreNMS/Validations/Programs.php.orig 2020-07-10 19:56:16 UTC
+++ LibreNMS/Validations/Programs.php
@@ -74,6 +74,7 @@ class Programs extends BaseValidation
return;
}
@@ -96,6 +96,7 @@ class Programs extends BaseValidation
private function failFping($validator, $cmd, $output)
{
+ $validator->warn("fping FAILURES can be ignored if running LibreNMS in a jail without ::1. You may want to test it manually: fping ::1");
$validator->fail(
"$bin could not be executed. $bin must have CAP_NET_RAW capability (getcap) or suid. Selinux exlusions may be required.\n ($output)"
"$cmd could not be executed. $cmd must have CAP_NET_RAW capability (getcap) or suid. Selinux exclusions may be required.\n ($output)"
);

View File

@ -0,0 +1,13 @@
--- LibreNMS/Validations/Python.php.orig 2020-07-20 21:06:40 UTC
+++ LibreNMS/Validations/Python.php
@@ -51,7 +51,9 @@ class Python extends BaseValidation
$this->checkVersion($validator, $version);
$this->checkPipVersion($validator, $version);
- $this->checkExtensions($validator);
+ # We've installed from a FreeBSD package.
+ # Wwe aren't using pip
+ #$this->checkExtensions($validator);
}
private function checkVersion(Validator $validator, $version)

View File

@ -1,6 +1,6 @@
--- LibreNMS/Validations/User.php.orig 2020-04-28 03:52:42 UTC
--- LibreNMS/Validations/User.php.orig 2020-07-10 19:56:16 UTC
+++ LibreNMS/Validations/User.php
@@ -85,6 +85,7 @@ class User extends BaseValidation
@@ -84,6 +84,7 @@ class User extends BaseValidation
"sudo chmod -R ug=rwX $rrd_dir $log_dir $dir/bootstrap/cache/ $dir/storage/",
];
@ -8,11 +8,11 @@
$find_result = rtrim(`find $dir \! -user $lnms_username -o \! -group $lnms_groupname 2> /dev/null`);
if (!empty($find_result)) {
// Ignore files created by the webserver
@@ -137,6 +138,7 @@ class User extends BaseValidation
$validator->result(ValidationResult::fail(
'Some folders have incorrect file permissions, this may cause issues.'
)->setFix($fix)->setList('Files', explode(PHP_EOL, $incorrect)));
@@ -117,6 +118,7 @@ class User extends BaseValidation
$validator->result($result);
return;
}
+ }
}
} else {
$validator->warn("You don't have \$config['user'] set, this most likely needs to be set to librenms");
$validator->warn("You don't have LIBRENMS_USER set, this most likely needs to be set to librenms");

View File

@ -1,17 +1,11 @@
--- config.php.default.orig 2020-04-28 03:52:42 UTC
--- config.php.default.orig 2020-07-10 19:56:16 UTC
+++ config.php.default
@@ -2,15 +2,20 @@
@@ -2,9 +2,14 @@
## Have a look in misc/config_definitions.json for examples of settings you can set here. DO NOT EDIT misc/config_definitions.json!
+$config['installed_from_package'] = true;
+
### Database config
$config['db_host'] = 'localhost';
$config['db_user'] = 'USERNAME';
$config['db_pass'] = 'PASSWORD';
$config['db_name'] = 'librenms';
+$config['log_dir'] = '/var/log/librenms';
+$config['rrd_dir'] = '/var/db/librenms/rrd';
+
@ -22,7 +16,7 @@
### This should *only* be set if you want to *force* a particular hostname/port
### It will prevent the web interface being usable form any other hostname
@@ -49,3 +54,22 @@ $config['enable_billing'] = 1;
@@ -43,3 +48,22 @@ $config['enable_billing'] = 1;
# Enable the in-built services support (Nagios plugins)
$config['show_services'] = 1;

View File

@ -1,28 +0,0 @@
--- html/install.php.orig 2020-04-30 14:13:30 UTC
+++ html/install.php
@@ -418,14 +418,14 @@ if ($stage == 0) {
# Update configuration
#\$config\['update_channel'\] = 'release'; # uncomment to follow the monthly release channel
-#\$config\['update'\] = 0; # uncomment to completely disable updates
+\$config\['update'\] = 0; # uncomment to completely disable updates
EOD;
if (!file_exists("{$librenms_dir}/config.php")) {
$conf = fopen("config.php", 'w');
if ($conf != false) {
if (fwrite($conf, "<?php\n") === false) {
- echo("<div class='alert alert-danger'>We couldn't create the config.php file, please create this manually before continuing by copying the below into a config.php in the root directory of your install (typically /opt/librenms/)</div>");
+ echo("<div class='alert alert-danger'>We couldn't create the config.php file, please create this manually before continuing by copying the below into a config.php in the root directory of your install (typically /usr/local/www/librenms/)</div>");
echo("<pre>&lt;?php\n".stripslashes($config_file)."</pre>");
} else {
$config_file = stripslashes($config_file);
@@ -433,7 +433,7 @@ EOD;
echo("<div class='alert alert-success'>The config file has been created</div>");
}
} else {
- echo("<div class='alert alert-danger'>We couldn't create the config.php file, please create this manually before continuing by copying the below into a config.php in the root directory of your install (typically /opt/librenms/)</div>");
+ echo("<div class='alert alert-danger'>We couldn't create the config.php file, please create this manually before continuing by copying the below into a config.php in the root directory of your install (typically /usr/local/www/librenms/)</div>");
echo("<pre>&lt;?php\n".stripslashes($config_file)."</pre>");
}
}

View File

@ -1,13 +1,13 @@
--- includes/common.php.orig 2018-10-17 10:33:28 UTC
--- includes/common.php.orig 2020-07-10 19:56:16 UTC
+++ includes/common.php
@@ -1158,6 +1158,10 @@ function version_info($remote = false)
@@ -1004,6 +1004,10 @@ function version_info($remote = false)
$output['local_sha'] = $local_sha;
$output['local_date'] = $local_date;
$output['local_branch'] = rtrim(`git rev-parse --abbrev-ref HEAD`);
+ } else {
+ $output['local_ver'] = '%%PORTVERSION%%';
+ # obtained via git show --pretty='%H|%ct' -s %%PORTVERSION%%
+ $output['local_date'] = %%RELEASE_TIMESTAMP%%;
+ $output['local_ver'] = '1.65.1';
+ # obtained via git show --pretty='%H|%ct' -s 1.65.1
+ $output['local_date'] = 1594410976;
}
$output['db_schema'] = dbIsConnected() ? get_db_schema() : '?';
$output['db_schema'] = vsprintf('%s (%s)', $version->database());
$output['php_ver'] = phpversion();

View File

@ -1,11 +1,11 @@
--- poller-wrapper.py.orig 2018-08-29 23:25:16 UTC
--- poller-wrapper.py.orig 2020-07-20 20:50:23 UTC
+++ poller-wrapper.py
@@ -37,6 +37,8 @@ except:
print "threading, Queue, sys, subprocess, time, os, json"
sys.exit(2)
@@ -27,6 +27,8 @@
import LibreNMS.library as LNMS
+os.environ['PATH'] += ':/usr/local/sbin:/usr/local/bin'
+
try:
import MySQLdb
except:
import json

View File

@ -13,33 +13,12 @@ it from /usr/local/etc/mysql/my.cnf
HEADS UP
Polling via cron job is now deprecated. Please use the Dispatcher.
Polling via cron job has been removed.. Please use the Dispatcher.
LibreNMS will be dropping support for PHP 7.1 and Python 2 in the next release
expected May 31 2020. see https://community.librenms.org/t/dropping-support-for-php-7-1-and-python-2/11851
LibreNMS will be dropped support for PHP 7.1 and Python 2
see https://community.librenms.org/t/dropping-support-for-php-7-1-and-python-2/11851
Your existing crontab entries for the PYPOLLER option will be going away.
You can migrate to the PYSERVICE option of LibreNMS now
(also known as the Dispatcher Service).
The next release will not include the the PYPOLLER option.
PYROLLER (deprecated) configuration (default):
The following lines should be added to /etc/crontab:
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
33 */6 * * * www cd %%WWWDIR%% && %%PHP%% discovery.php -h all >> /dev/null 2>&1
*/5 * * * * www cd %%WWWDIR%% && %%PHP%% discovery.php -h new >> /dev/null 2>&1
*/5 * * * * www cd %%WWWDIR%% && %%PYTHON%% poller-wrapper.py 16 >> /dev/null 2>&1
15 0 * * * www %%LOCALBASE%%/bin/bash %%WWWDIR%%/daily.sh >> /dev/null 2>&1
* * * * * www %%PHP%% %%WWWDIR%%/alerts.php >> /dev/null 2>&1
*/5 * * * * www %%PHP%% %%WWWDIR%%/poll-billing.php >> /dev/null 2>&1
01 * * * * www %%PHP%% %%WWWDIR%%/billing-calculate.php >> /dev/null 2>&1
*/5 * * * * www %%PHP%% %%WWWDIR%%/check-services.php >> /dev/null 2>&1
PYSERVICE configuration (non-default):
Your existing crontab entries are no longer useful and should be deleted.
Enable the poller service with this command:
@ -65,8 +44,6 @@ these steps will help you get started:
When setting up a new install, you need a %%WWWDIR%%/.env file.
You need an APP_KEY.
To create:
cd %%WWWDIR%%
@ -74,28 +51,27 @@ cp -i .env.example .env
That file will eventually contain secrets. Make sure it is not world-readable.
When migrating to PYSERVICE (also known as the Dispatcher Service):
It is also a good idea to:
cd %%WWWDIR%%
./validate
Database connection details are required in that file.
Then run:
php artisan key:generate
sudo php artisan key:generate
It should write directly to your .env file
The output should look something like this:
**************************************
* Application In Production! *
**************************************
$ sudo php artisan key:generate
Application key set successfully.
Do you really wish to run this command? (yes/no) [no]:
> y
When migrating to PYSERVICE (also known as the Dispatcher Service):
It is also a good idea to:
cd %%WWWDIR%%
sudo ./validate.php
You need an APP_KEY.
Application key [base64:P62La9V........qw=] set successfully.
After that, follow the LibreNMS documentation for configuration.
@ -108,21 +84,21 @@ Depending on the version, you may have to run the upgrade script.
cd %%WWWDIR%%
./build-base.php
Or the database upgrade script:
./lnms migrate
re: https://docs.librenms.org/#General/Updating/
HEADS UP HEADS UP HEADS UP HEADS UP HEADS UP HEADS UP HEADS UP HEADS UP
HEADS UP HEADS UP HEADS UP HEADS UP HEADS UP HEADS UP HEADS UP HEADS UP
HEADS UP HEADS UP HEADS UP HEADS UP HEADS UP HEADS UP HEADS UP HEADS UP
Polling via cron job is now deprecated. Please use the Dispatcher.
Polling via cron job is now gone. Please use the Dispatcher.
LibreNMS will be dropping support for PHP 7.1 and Python 2 in the next release
expected May 31 2020. see https://community.librenms.org/t/dropping-support-for-php-7-1-and-python-2/11851
LibreNMS will be droppped support for PHP 7.1 and Python 2.
see https://community.librenms.org/t/dropping-support-for-php-7-1-and-python-2/11851
Your existing crontab entries for the PYPOLLER option will be going away.
You can migrate to the PYSERVICE option of LibreNMS now
(also known as the Dispatcher Service).
The next release will not include the PYPOLLER option.
Your existing crontab entries can be deleted.
For more information, see pkg info --pkg-message librenms