diff --git a/.travis.yml b/.travis.yml index 6236284729..0d0e333b3e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,17 +3,30 @@ matrix: fast_finish: true include: - php: 7.0 - env: PHP_L=1 + env: + PHP_L=1 + EXECUTE_BUILD_DOCS=false - php: 5.3 - env: PHP_L_OLD=1 + env: + PHP_L_OLD=1 + EXECUTE_BUILD_DOCS=false - php: 5.4 - env: PHP_L_OLD=1 + env: + PHP_L_OLD=1 + EXECUTE_BUILD_DOCS=false - php: 5.5 - env: PHP_L=1 + env: + PHP_L=1 + EXECUTE_BUILD_DOCS=false - php: 5.6 - env: PHP_L=1 PHPCS=1 + env: + PHP_L=1 + PHPCS=1 + EXECUTE_BUILD_DOCS=true - php: hhvm - env: PHP_L_OLD=1 + env: + PHP_L_OLD=1 + EXECUTE_BUILD_DOCS=false allow_failures: - php: 7.0 @@ -27,7 +40,11 @@ cache: before_script: - composer install --prefer-dist --no-interaction +after_success: + - test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && test $EXECUTE_BUILD_DOCS == "true" && bash scripts/deploy-docs.sh + script: - if [[ $PHP_L == 1 ]]; then find . -path './vendor' -prune -o -name "*.php" -print0 | xargs -0 -n1 -P8 php -l | grep -v '^No syntax errors detected' ; test $? -eq 1; fi - if [[ $PHP_L_OLD == 1 ]]; then find . -regextype posix-extended -regex "\./(lib/influxdb-php|vendor)" -prune -o -name "*.php" -print0 | xargs -0 -n1 -P8 php -l | grep -v '^No syntax errors detected' ; test $? -eq 1; fi - if [[ $PHP_CS == 1 ]]; then vendor/bin/phpcs -n -p --colors --extensions=php --standard=PSR2 --ignore=html/lib/* .; fi + - phpunit diff --git a/AUTHORS.md b/AUTHORS.md index 0880f55c21..b769717c7a 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -119,6 +119,7 @@ LibreNMS contributors: - Vladislav Solovei (vladsol) - Daniel van Dorp (djvdorp) - Phil Regnauld (reegnauld) +- Bennett Blodinger (benwa) [1]: http://observium.org/ "Observium web site" Observium was written by: diff --git a/doc/Hardware/Dell-OpenManage.md b/doc/Extensions/Dell-OpenManage.md similarity index 100% rename from doc/Hardware/Dell-OpenManage.md rename to doc/Extensions/Dell-OpenManage.md diff --git a/doc/Extensions/RRDCached.md b/doc/Extensions/RRDCached.md index 499a27aee2..987a6e7cb8 100644 --- a/doc/Extensions/RRDCached.md +++ b/doc/Extensions/RRDCached.md @@ -107,5 +107,5 @@ Disk I/O can be found under the menu Devices>All Devices>[localhost hostname]>He Depending on many factors, you should see the Ops/sec drop by ~30-40%. -[1]: http://librenms.readthedocs.org/Installation/Installation-(RHEL-CentOS)/#add-localhost +[1]: http://librenms.readthedocs.org/Installation/Installation-CentOS-7-Apache/ "Add localhost to LibreNMS" diff --git a/doc/Extensions/Smokeping.md b/doc/Extensions/Smokeping.md index 92c4e60780..4a892dcb25 100644 --- a/doc/Extensions/Smokeping.md +++ b/doc/Extensions/Smokeping.md @@ -51,7 +51,7 @@ You should now see a new tab in your device page called ping. ### Install and integrate Smokeping [Debian/Ubuntu] ### -> This guide assumes you have already installed librenms, and you installed apache2 in the process. Tested with Ubuntu 14.04 and Apache 2.4. +> This guide assumes you have already installed librenms, and you installed apache2 in the process. Tested with Ubuntu 14.04 and Apache 2.4. Nearly everything we do will require root, and at one point we'll encounter a problem if we just use sudo, so we'll just switch to root at the beginning... diff --git a/doc/Extensions/Varnish.md b/doc/Extensions/Varnish.md index 6e44215086..0c1d9e610a 100644 --- a/doc/Extensions/Varnish.md +++ b/doc/Extensions/Varnish.md @@ -13,7 +13,7 @@ Varnish is caching software that sits logically between an HTTP client and an HT In this example we will assume your Apache 2.4.X HTTP server is working and configured to process HTTP requests on port 80. If not, please see -[Using HTTPd Apache2](http://librenms.readthedocs.org/Installation/Installation-(RHEL-CentOS)/#using-httpd-apache2) +[Installing LibreNMS](http://librenms.readthedocs.org/Installation/Installing-CentOS-7-Apache) #### Install Varnish 4.0 RPM #### diff --git a/doc/Installation/Installation-(RHEL-CentOS).md b/doc/Installation/Installation-CentOS-6-Apache-Nginx.md similarity index 99% rename from doc/Installation/Installation-(RHEL-CentOS).md rename to doc/Installation/Installation-CentOS-6-Apache-Nginx.md index 12c6556a32..06270ac05e 100644 --- a/doc/Installation/Installation-(RHEL-CentOS).md +++ b/doc/Installation/Installation-CentOS-6-Apache-Nginx.md @@ -1,4 +1,4 @@ -NOTE: What follows is a very rough list of commands. This works on a fresh install of CentOS 6.4 and CentOS 7. +NOTE: What follows is a very rough list of commands. This works on a fresh install of CentOS 6.x. NOTE: These instructions assume you are the root user. If you are not, prepend `sudo` to all shell commands (the ones that aren't at `mysql>` prompts) or temporarily become a user with root privileges with `sudo -s`. diff --git a/doc/Installation/Installation-(Debian-Ubuntu).md b/doc/Installation/Installation-Ubuntu-1404-Apache.md similarity index 100% rename from doc/Installation/Installation-(Debian-Ubuntu).md rename to doc/Installation/Installation-Ubuntu-1404-Apache.md diff --git a/doc/Installation/Installation-Lighttpd-(Debian-Ubuntu).md b/doc/Installation/Installation-Ubuntu-1404-Lighttpd.md similarity index 100% rename from doc/Installation/Installation-Lighttpd-(Debian-Ubuntu).md rename to doc/Installation/Installation-Ubuntu-1404-Lighttpd.md diff --git a/doc/Installation/Installation-Nginx-(Debian-Ubuntu).md b/doc/Installation/Installation-Ubuntu-1404-Nginx.md similarity index 100% rename from doc/Installation/Installation-Nginx-(Debian-Ubuntu).md rename to doc/Installation/Installation-Ubuntu-1404-Nginx.md diff --git a/doc/Installation/Installing-LibreNMS.md b/doc/Installation/Installing-LibreNMS.md index ca88307853..f161a8c250 100644 --- a/doc/Installation/Installing-LibreNMS.md +++ b/doc/Installation/Installing-LibreNMS.md @@ -20,10 +20,10 @@ If you want to install yourself then we have some new documentation which should If the above are missing or incomplete then you can try our old docs below. -[Debian/Ubuntu](http://docs.librenms.org/Installation/Installation-(Debian-Ubuntu)/) +[Debian/Ubuntu](http://docs.librenms.org/Installation/Installation-Ubuntu-1404-Apache/) -[RHEL/CentOS](http://docs.librenms.org/Installation/Installation-(RHEL-CentOS)/ +[RHEL/CentOS](http://docs.librenms.org/Installation/Installation-CentOS-6-Apache-Nginx/ -[Debian/Ubuntu Lighttpd](http://docs.librenms.org/Installation/Installation-Lighttpd-(Debian-Ubuntu)/) +[Debian/Ubuntu Lighttpd](http://docs.librenms.org/Installation/Installation-Ubuntu-1404-Lighttpd/) -[Debian/Ubuntu Nginx](http://docs.librenms.org/Installation/Installation-Nginx-(Debian-Ubuntu)/) +[Debian/Ubuntu Nginx](http://docs.librenms.org/Installation/Installation-Ubuntu-1404-Nginx/) diff --git a/doc/index.md b/doc/index.md index 1fd87742d7..3e6e8809b0 100644 --- a/doc/index.md +++ b/doc/index.md @@ -1 +1,14 @@ -# Welcome to the documentation for [LibreNMS](https://github.com/librenms/librenms) +### Welcome to the LibreNMS docs + +Some of these docs are work in progress or may be missing configuration examples for varying distros. +If you find this is the case then please feel free to edit them on [GitHub](https://github.com/librenms/librenms/tree/master/doc) +and submit a pull request. + +The docs should provide you with information on various elements to the software: + + - Installation + - Support / FAQ + - Developing for LibreNMS + - Available extensions + + diff --git a/doc/librenms.css b/doc/librenms.css new file mode 100644 index 0000000000..d5e2ab61e8 --- /dev/null +++ b/doc/librenms.css @@ -0,0 +1,9 @@ +body { + background-image:none !important; +} + +.dropdown-menu { + max-height: 400px !important; + overflow-x: hidden !important; +} + diff --git a/html/includes/common/device-summary-horiz.inc.php b/html/includes/common/device-summary-horiz.inc.php index 130d21e786..630af1ba3e 100644 --- a/html/includes/common/device-summary-horiz.inc.php +++ b/html/includes/common/device-summary-horiz.inc.php @@ -5,7 +5,7 @@ $temp_output = '
- + @@ -16,7 +16,7 @@ $temp_output = ' - + @@ -25,7 +25,7 @@ $temp_output = ' '.($config['summary_errors'] ? '' : '').' - + @@ -36,7 +36,7 @@ $temp_output = ' '; if ($config['show_services']) { $temp_output .= ' - + diff --git a/html/includes/common/device-summary-vert.inc.php b/html/includes/common/device-summary-vert.inc.php index 267e8f10b2..d51dda53fc 100644 --- a/html/includes/common/device-summary-vert.inc.php +++ b/html/includes/common/device-summary-vert.inc.php @@ -5,7 +5,7 @@ $temp_output = '
  Total Up
Devices '.$devices['count'].' '.$devices['up'].' '.$devices['disabled'].'-
Ports '.$ports['count'].' '.$ports['up'].'
Services '.$services['count'].' '.$services['up'].'
- + @@ -21,7 +21,7 @@ $temp_output .= ' - + @@ -34,7 +34,7 @@ if ($config['show_services']) { $temp_output .= ' - + @@ -48,7 +48,7 @@ if ($config['show_services']) { $temp_output .= ' - + @@ -62,7 +62,7 @@ if ($config['show_services']) { $temp_output .= ' - + @@ -77,7 +77,7 @@ if ($config['show_services']) { if ($config['summary_errors']) { $temp_output .= ' - + @@ -91,7 +91,7 @@ if ($config['summary_errors']) { $temp_output .= ' - + diff --git a/includes/rrdtool.inc.php b/includes/rrdtool.inc.php index 58ed1e5ea4..bd4eff76aa 100644 --- a/includes/rrdtool.inc.php +++ b/includes/rrdtool.inc.php @@ -153,7 +153,7 @@ function rrdtool($command, $filename, $options, $timeout = 0) global $config, $debug, $vdebug, $rrd_pipes; // do not ovewrite files when creating - if ($command == 'create') { + if ($command == 'create' && version_compare($config['rrdtool_version'], '1.4.3', '>=')) { $options .= ' -O'; } // rrdcached commands: >=1.5.5: all, >=1.5 all: except tune, <1.5: all except tune and create @@ -180,8 +180,8 @@ function rrdtool($command, $filename, $options, $timeout = 0) ) { c_echo("[%rRRD Disabled%n]\n"); $output = array(null, null); - } elseif ($command == 'create' && version_compare($config['rrdtool_version'], '1.5', '<') && is_file($filename)) { - // do not overwrite RRD if it already exists and RRDTool ver. < 1.5 + } elseif ($command == 'create' && version_compare($config['rrdtool_version'], '1.4.3', '<') && is_file($filename)) { + // do not overwrite RRD if it already exists and RRDTool ver. < 1.4.3 c_echo("RRD[%g$filename already exists%n]\n", $debug); $output = array(null, null); } else { diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000000..0d58c748a0 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,14 @@ +site_name: LibreNMS Documentation +theme: mkdocs +docs_dir: doc +site_dir: out +site_url: http://docs.librenms.org +markdown_extensions: + - pymdownx.superfences +extra_css: + - librenms.css +include_next_prev: false +site_author: LibreNMS +site_description: LibreNMS user and developer documentation +repo_url: https://github.com/librenms/librenms +repo_name: GitHub diff --git a/scripts/deploy-docs.sh b/scripts/deploy-docs.sh new file mode 100644 index 0000000000..b7cd582be0 --- /dev/null +++ b/scripts/deploy-docs.sh @@ -0,0 +1,28 @@ +#!/bin/bash +GH_REPO="@github.com/librenms-docs/librenms-docs.github.io.git" +FULL_REPO="https://${GH_TOKEN}$GH_REPO" + +pip install --user mkdocs +pip install --user pymdown-extensions + +mkdir -p out + +cd out + +git init +git remote add origin $FULL_REPO +git fetch +git config user.name "librenms-docs" +git config user.email "travis@librenms.org" +git checkout master + +cd ../ + +mkdocs build --clean + +cd out + +touch . +git add -A . +git commit -m "GH-Pages update by travis after $TRAVIS_COMMIT" +git push -q origin master
Summary Devices Ports
Up '. $devices['up'] .' '. $ports['up'] .'
Down '. $devices['down'] .' '. $ports['down'] .'
Ignored '. $devices['ignored'] .' '. $ports['ignored'] .'
Disabled/Shutdown '. $devices['disabled'] .' '. $ports['shutdown'] .'
Errored - '.$ports['errored'].'
Total '. $devices['count'] .' '. $ports['count'] .'