update to librenms-1.24

reluctantly add a run dep on bash, it's getting to be a bit of a maintenance
problem to keep patching daily.sh to work with ksh.
This commit is contained in:
sthen 2017-01-31 22:43:29 +00:00
parent a172e26467
commit bbb087f745
18 changed files with 3685 additions and 3993 deletions

View File

@ -1,10 +1,10 @@
# $OpenBSD: Makefile,v 1.35 2016/12/14 21:37:03 sthen Exp $
# $OpenBSD: Makefile,v 1.36 2017/01/31 22:43:29 sthen Exp $
COMMENT = auto-discovering network management/monitoring system
GH_ACCOUNT = librenms
GH_PROJECT = librenms
GH_TAGNAME = 1.22.01
GH_TAGNAME = 1.24
EPOCH = 0
CATEGORIES = net www
@ -34,6 +34,7 @@ RUN_DEPENDS = databases/py-mysql \
net/pear-Net-IPv4 \
net/pear-Net-IPv6 \
net/rrdtool \
shells/bash \
sysutils/ipmitool
NO_BUILD = Yes
@ -45,7 +46,7 @@ PREFIX = /var/www
INSTDIR = ${PREFIX}/librenms
SUBST_VARS = INSTDIR MODPHP_BIN
R = s,^\#!( )?/bin/bash,\#!${LOCALBASE}/bin/bash,;
R = s,^\#!( )?(/usr/bin/env |/bin/)bash,\#!${LOCALBASE}/bin/bash,;
R += s,^\#!( )?/usr/bin/(env )?python.*,\#!${MODPY_BIN},;
R += s,^\#!( )?/usr/bin/(env )?php,\#!${MODPHP_BIN},;
R += s,/opt/librenms,/var/www/librenms,g;

View File

@ -1,2 +1,2 @@
SHA256 (librenms-1.22.01.tar.gz) = ghs2j36E5aWxRB7fmEVMoxQzfX3ZkNgF0hd4hhN+qcM=
SIZE (librenms-1.22.01.tar.gz) = 32812938
SHA256 (librenms-1.24.tar.gz) = T4dEsG8oCMOu8dc2sw/C++Ghbvr555PV8NR6tzcTo9Q=
SIZE (librenms-1.24.tar.gz) = 54959245

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-config_php_default,v 1.6 2016/12/14 21:37:03 sthen Exp $
--- config.php.default.orig Fri Dec 2 10:38:41 2016
+++ config.php.default Fri Dec 2 10:38:50 2016
$OpenBSD: patch-config_php_default,v 1.7 2017/01/31 22:43:30 sthen Exp $
--- config.php.default.orig Tue Jan 31 16:57:10 2017
+++ config.php.default Tue Jan 31 16:57:24 2017
@@ -10,15 +10,16 @@ $config['db_name'] = 'librenms';
// This is the user LibreNMS will run as

View File

@ -1,79 +1,58 @@
$OpenBSD: patch-daily_sh,v 1.14 2016/12/14 21:37:03 sthen Exp $
- use ksh
- patch php binary name
- avoid ${cnf,,} bashism (converts to lowercase); actually the
result was being ignored anyway
--- daily.sh.orig Wed Dec 14 17:43:14 2016
+++ daily.sh Wed Dec 14 17:47:00 2016
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/ksh
################################################################################
# Copyright (C) 2015 Daniel Preussker, QuxLabs UG <preussker@quxlabs.com>
# Layne "Gorian" Breitkreutz <Layne.Breitkreutz@thelenon.com>
@@ -24,7 +24,7 @@ DIR_LIBRENMS=$(dirname "$(readlink -f "$0")")
$OpenBSD: patch-daily_sh,v 1.15 2017/01/31 22:43:30 sthen Exp $
--- daily.sh.orig Tue Jan 31 22:32:18 2017
+++ daily.sh Tue Jan 31 22:39:00 2017
@@ -25,10 +25,10 @@ LIBRENMS_DIR=$(dirname "$DAILY_SCRIPT")
# set log_file, using librenms $config['log_dir'], if set
# otherwise we default to <LibreNMS Install Directory>/logs
-LOG_DIR=$(php -r "include '${DIR_LIBRENMS}/config.php'; echo isset(\$config['log_dir']) ? \$config['log_dir'] : '${DIR_LIBRENMS}/logs';")
+LOG_DIR=$(%PHP% -r "include '${DIR_LIBRENMS}/config.php'; echo isset(\$config['log_dir']) ? \$config['log_dir'] : '${DIR_LIBRENMS}/logs';")
-LOG_DIR=$(php -r "@include '${LIBRENMS_DIR}/config.php'; echo isset(\$config['log_dir']) ? \$config['log_dir'] : '${LIBRENMS_DIR}/logs';")
+LOG_DIR=$(%PHP% -r "@include '${LIBRENMS_DIR}/config.php'; echo isset(\$config['log_dir']) ? \$config['log_dir'] : '${LIBRENMS_DIR}/logs';")
# get the librenms user
-LIBRENMS_USER=$(php -r "@include '${LIBRENMS_DIR}/config.php'; echo isset(\$config['user']) ? \$config['user'] : 'root';")
+LIBRENMS_USER=$(%PHP% -r "@include '${LIBRENMS_DIR}/config.php'; echo isset(\$config['user']) ? \$config['user'] : 'root';")
LIBRENMS_USER_ID=$(id -u "$LIBRENMS_USER")
#######################################
@@ -52,7 +52,7 @@ status_run() {
printf "%-50s" "${arg_text}";
echo "${arg_text}" >> ${log_file}
- tmp=$(bash -c "${arg_command}" 2>&1);
+ tmp=$(sh -c "${arg_command}" 2>&1);
exit_code=$?
echo "${tmp}" >> ${log_file}
echo "Returned: ${exit_code}" >> ${log_file}
@@ -82,7 +82,7 @@ call_daily_php() {
@@ -70,7 +70,7 @@ status_run() {
else
printf " \033[0;31mFAIL\033[0m\n";
if [[ "${arg_option}" == "update" ]]; then
- php "${LIBRENMS_DIR}/daily.php" -f notify -o "${tmp}"
+ %PHP% "${LIBRENMS_DIR}/daily.php" -f notify -o "${tmp}"
fi
fi
return ${exit_code}
@@ -91,7 +91,7 @@ call_daily_php() {
local args=( "$@" );
for arg in "${args[@]}"; do
- php "${DIR_LIBRENMS}/daily.php" -f "${arg}";
+ %PHP% "${DIR_LIBRENMS}/daily.php" -f "${arg}";
- php "${LIBRENMS_DIR}/daily.php" -f "${arg}";
+ %PHP% "${LIBRENMS_DIR}/daily.php" -f "${arg}";
done
}
@@ -100,7 +100,7 @@ main () {
cd ${DIR_LIBRENMS};
@@ -123,7 +123,7 @@ main () {
fi
if [[ -z "$arg" ]]; then
- up=$(php daily.php -f update >&2; echo $?)
+ up=$(%PHP% daily.php -f update >&2; echo $?)
if [[ "$up" == "0" ]]; then
$0 no-code-update
$DAILY_SCRIPT no-code-update
exit
@@ -123,11 +123,7 @@ main () {
fi
cnf=$(echo $(grep '\[.distributed_poller.\]' config.php | egrep -v -e '^//' -e '^#' | cut -d = -f 2 | sed 's/;//g'))
- if ((${BASH_VERSINFO[0]} < 4)); then
- cnf=`echo $cnf|tr [:upper:] [:lower:]`
- else
- cnf=${cnf,,}
- fi
+ cnf=`echo $cnf|tr [:upper:] [:lower:]`
if [[ -z "$cnf" ]] || [[ "$cnf" == "0" ]] || [[ "$cnf" == "false" ]]; then
# Call ourself again in case above pull changed or added something to daily.sh
@@ -138,12 +134,12 @@ main () {
@@ -161,12 +161,12 @@ main () {
no-code-update)
# Updates of the code are disabled, just check for schema updates
# and clean up the db.
- status_run 'Updating SQL-Schema' 'php includes/sql-schema/update.php'
+ status_run 'Updating SQL-Schema' '%PHP% includes/sql-schema/update.php'
status_run 'Cleaning up DB' "$0 cleanup"
status_run 'Cleaning up DB' "$DAILY_SCRIPT cleanup"
;;
post-pull)
# List all tasks to do after pull in the order of execution
- status_run 'Updating SQL-Schema' 'php includes/sql-schema/update.php'
+ status_run 'Updating SQL-Schema' '%PHP% includes/sql-schema/update.php'
status_run 'Updating submodules' "$0 submodules"
status_run 'Cleaning up DB' "$0 cleanup"
status_run 'Fetching notifications' "$0 notifications"
status_run 'Updating submodules' "$DAILY_SCRIPT submodules"
status_run 'Cleaning up DB' "$DAILY_SCRIPT cleanup"
status_run 'Fetching notifications' "$DAILY_SCRIPT notifications"

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-html_install_php,v 1.10 2016/12/14 21:37:03 sthen Exp $
--- html/install.php.orig Fri Dec 2 10:38:42 2016
+++ html/install.php Fri Dec 2 10:38:50 2016
@@ -365,7 +365,8 @@ $config_file = <<<"EOD"
$OpenBSD: patch-html_install_php,v 1.11 2017/01/31 22:43:30 sthen Exp $
--- html/install.php.orig Tue Jan 31 16:57:11 2017
+++ html/install.php Tue Jan 31 16:57:24 2017
@@ -376,7 +376,8 @@ $config_file = <<<"EOD"
#\$config\['base_url'\] = "http://librenms.company.com";
### Enable this to use rrdcached. Be sure rrd_dir is within the rrdcached dir

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-html_pages_about_inc_php,v 1.5 2016/12/14 21:37:03 sthen Exp $
--- html/pages/about.inc.php.orig Fri Dec 2 10:38:43 2016
+++ html/pages/about.inc.php Fri Dec 2 10:38:50 2016
$OpenBSD: patch-html_pages_about_inc_php,v 1.6 2017/01/31 22:43:30 sthen Exp $
--- html/pages/about.inc.php.orig Tue Jan 31 16:57:11 2017
+++ html/pages/about.inc.php Tue Jan 31 16:57:24 2017
@@ -157,7 +157,7 @@ $version_date = $versions['local_date'];
echo "
<div class='table-responsive'>

View File

@ -1,18 +1,18 @@
$OpenBSD: patch-includes_common_php,v 1.7 2016/12/14 21:37:03 sthen Exp $
--- includes/common.php.orig Wed Dec 14 17:47:31 2016
+++ includes/common.php Wed Dec 14 17:55:30 2016
@@ -1109,16 +1109,15 @@ function version_info($remote = true)
curl_setopt($api, CURLOPT_RETURNTRANSFER, 1);
$output['github'] = json_decode(curl_exec($api), true);
$OpenBSD: patch-includes_common_php,v 1.8 2017/01/31 22:43:30 sthen Exp $
--- includes/common.php.orig Tue Jan 31 16:57:12 2017
+++ includes/common.php Tue Jan 31 22:12:11 2017
@@ -1095,16 +1095,15 @@ function version_info($remote = true)
curl_setopt($api, CURLOPT_RETURNTRANSFER, 1);
$output['github'] = json_decode(curl_exec($api), true);
}
- list($local_sha, $local_date) = explode('|', rtrim(`git show --pretty='%H|%ct' -s HEAD`));
- $output['local_sha'] = $local_sha;
- $output['local_date'] = $local_date;
- $output['local_branch'] = rtrim(`git rev-parse --abbrev-ref HEAD`);
+ $output['local_sha'] = '';
+ $output['local_date'] = '';
+ $output['local_branch'] = '';
}
- list($local_sha, $local_date) = explode('|', rtrim(`git show --pretty='%H|%ct' -s HEAD`));
- $output['local_sha'] = $local_sha;
- $output['local_date'] = $local_date;
- $output['local_branch'] = rtrim(`git rev-parse --abbrev-ref HEAD`);
+ $output['local_sha'] = '';
+ $output['local_date'] = '';
+ $output['local_branch'] = '';
$output['db_schema'] = dbFetchCell('SELECT version FROM dbSchema');
$output['php_ver'] = phpversion();
$output['mysql_ver'] = dbFetchCell('SELECT version()');

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-includes_defaults_inc_php,v 1.18 2016/12/14 21:37:03 sthen Exp $
--- includes/defaults.inc.php.orig Fri Dec 2 10:38:43 2016
+++ includes/defaults.inc.php Fri Dec 2 10:38:50 2016
@@ -36,26 +36,26 @@ $config['db']['extension'] = 'mysqli';//mysql an
$OpenBSD: patch-includes_defaults_inc_php,v 1.19 2017/01/31 22:43:30 sthen Exp $
--- includes/defaults.inc.php.orig Tue Jan 31 16:57:12 2017
+++ includes/defaults.inc.php Tue Jan 31 16:57:24 2017
@@ -41,26 +41,26 @@ $config['db_port'] = 3306;
$config['own_hostname'] = 'localhost';
// Location of executables
@ -43,7 +43,7 @@ $OpenBSD: patch-includes_defaults_inc_php,v 1.18 2016/12/14 21:37:03 sthen Exp $
// Memcached - Keep immediate statistics
$config['memcached']['enable'] = false;
@@ -451,11 +451,11 @@ $config['billing']['bill_autoadd'] = 0;
@@ -456,11 +456,11 @@ $config['billing']['bill_autoadd'] = 0;
$config['billing']['base'] = 1000;
// Set the base to divider bytes to kB, MB, GB ,... (1000|1024)
// External Integration
@ -58,7 +58,7 @@ $OpenBSD: patch-includes_defaults_inc_php,v 1.18 2016/12/14 21:37:03 sthen Exp $
$config['smokeping']['pings'] = 20;
// $config['oxidized']['enabled'] = FALSE;//Set to TRUE
// $config['oxidized']['url'] = 'http://127.0.0.1:8888';// Set the Oxidized rest URL
@@ -463,7 +463,7 @@ $config['smokeping']['pings'] = 20;
@@ -468,7 +468,7 @@ $config['smokeping']['pings'] = 20;
// NFSen RRD dir.
$config['nfsen_enable'] = 0;
// $config['nfsen_split_char'] = "_";
@ -67,7 +67,7 @@ $OpenBSD: patch-includes_defaults_inc_php,v 1.18 2016/12/14 21:37:03 sthen Exp $
// $config['nfsen_suffix'] = "_yourdomain_com";
// Location Mapping
// Use this feature to map ugly locations to pretty locations
@@ -795,7 +795,7 @@ $config['api_demo'] = 0;
@@ -801,7 +801,7 @@ $config['api_demo'] = 0;
// Set this to 1 if you want to disable some untrusting features for the API
// Distributed Poller-Settings
$config['distributed_poller'] = false;

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-includes_functions_php,v 1.4 2016/12/14 21:37:03 sthen Exp $
--- includes/functions.php.orig Fri Dec 2 10:38:43 2016
+++ includes/functions.php Fri Dec 2 10:38:50 2016
@@ -235,7 +235,7 @@ function delete_device($id)
$OpenBSD: patch-includes_functions_php,v 1.5 2017/01/31 22:43:30 sthen Exp $
--- includes/functions.php.orig Tue Jan 31 16:57:12 2017
+++ includes/functions.php Tue Jan 31 16:57:24 2017
@@ -345,7 +345,7 @@ function delete_device($id)
}
}

View File

@ -1,15 +0,0 @@
$OpenBSD: patch-includes_polling_core_inc_php,v 1.3 2016/10/14 12:48:55 sthen Exp $
OpenBSD snmpd(8)'s snmpEngineTime.0 is bogus
--- includes/polling/core.inc.php.orig Fri Oct 14 13:25:22 2016
+++ includes/polling/core.inc.php Fri Oct 14 13:27:33 2016
@@ -44,7 +44,7 @@ if (empty($uptime)) {
}//end if
if ($device["os"] != "edgeswitch") {
- if ($snmp_uptime > $uptime && is_numeric($snmp_uptime)) {
+ if ($snmp_uptime > $uptime && is_numeric($snmp_uptime) && $snmp_uptime < 1000000000) {
$uptime = $snmp_uptime;
d_echo('hrSystemUptime or sysUpTime looks like to have rolled, using snmpEngineTime instead');
}

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-lib_influxdb-php_requirements_sh,v 1.1 2016/08/19 14:39:04 sthen Exp $
--- lib/influxdb-php/requirements.sh.orig Fri Aug 12 14:20:40 2016
+++ lib/influxdb-php/requirements.sh Fri Aug 12 14:20:54 2016
$OpenBSD: patch-lib_influxdb-php_requirements_sh,v 1.2 2017/01/31 22:43:30 sthen Exp $
--- lib/influxdb-php/requirements.sh.orig Tue Jan 31 16:57:13 2017
+++ lib/influxdb-php/requirements.sh Tue Jan 31 16:57:24 2017
@@ -1,6 +1,4 @@
-#!/usr/local/bin/bash
-

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-librenms_nonroot_cron,v 1.5 2016/10/14 12:48:55 sthen Exp $
--- librenms.nonroot.cron.orig Fri Oct 14 13:25:25 2016
+++ librenms.nonroot.cron Fri Oct 14 13:25:33 2016
$OpenBSD: patch-librenms_nonroot_cron,v 1.6 2017/01/31 22:43:30 sthen Exp $
--- librenms.nonroot.cron.orig Tue Jan 31 16:57:14 2017
+++ librenms.nonroot.cron Tue Jan 31 16:57:24 2017
@@ -1,10 +1,10 @@
# Using this cron file requires an additional user on your system, please see install docs.

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-poller-wrapper_py,v 1.7 2016/10/14 12:48:55 sthen Exp $
--- poller-wrapper.py.orig Fri Oct 14 13:25:32 2016
+++ poller-wrapper.py Fri Oct 14 13:25:33 2016
$OpenBSD: patch-poller-wrapper_py,v 1.8 2017/01/31 22:43:30 sthen Exp $
--- poller-wrapper.py.orig Tue Jan 31 16:57:21 2017
+++ poller-wrapper.py Tue Jan 31 16:57:24 2017
@@ -53,7 +53,7 @@ config_file = ob_install_dir + '/config.php'
@ -18,8 +18,8 @@ $OpenBSD: patch-poller-wrapper_py,v 1.7 2016/10/14 12:48:55 sthen Exp $
+poller_path = ob_install_dir + '/poller.php'
db_username = config['db_user']
db_password = config['db_pass']
@@ -296,7 +296,7 @@ def poll_worker():
db_port = int(config['db_port'])
@@ -293,7 +293,7 @@ def poll_worker():
# EOC5
try:
start_time = time.time()

View File

@ -1,9 +0,0 @@
$OpenBSD: patch-scripts_cron-hourly_sh,v 1.1.1.1 2015/04/23 16:44:34 sthen Exp $
--- scripts/cron-hourly.sh.orig Fri Mar 20 15:17:16 2015
+++ scripts/cron-hourly.sh Fri Mar 20 15:17:16 2015
@@ -1,4 +1,4 @@
-#!/usr/local/bin/bash
+#!/bin/sh
./discovery.php -h even &
./discovery.php -h odd &
./generate-map.sh

View File

@ -1,9 +0,0 @@
$OpenBSD: patch-scripts_cron-minute_sh,v 1.1.1.1 2015/04/23 16:44:34 sthen Exp $
--- scripts/cron-minute.sh.orig Fri Mar 20 15:17:16 2015
+++ scripts/cron-minute.sh Fri Mar 20 15:17:16 2015
@@ -1,4 +1,4 @@
-#!/usr/local/bin/bash
+#!/bin/sh
./process-syslog.php
#sleep 10

View File

@ -1,9 +0,0 @@
$OpenBSD: patch-scripts_cron_sh,v 1.1.1.1 2015/04/23 16:44:34 sthen Exp $
--- scripts/cron.sh.orig Fri Mar 20 15:17:16 2015
+++ scripts/cron.sh Fri Mar 20 15:17:16 2015
@@ -1,4 +1,4 @@
-#!/usr/local/bin/bash
+#!/bin/sh
#./discovery.php -h forced >> /var/log/observer.log &

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-validate_php,v 1.8 2016/12/14 21:37:03 sthen Exp $
--- validate.php.orig Wed Dec 14 17:43:27 2016
+++ validate.php Wed Dec 14 17:43:50 2016
$OpenBSD: patch-validate_php,v 1.9 2017/01/31 22:43:30 sthen Exp $
--- validate.php.orig Tue Jan 31 16:57:21 2017
+++ validate.php Tue Jan 31 22:08:48 2017
@@ -45,7 +45,7 @@ if (!file_exists('config.php')) {
}

File diff suppressed because it is too large Load Diff