diff --git a/doc/Agent.md b/doc/Agent.md index cd7e2eb59..687d36cb8 100644 --- a/doc/Agent.md +++ b/doc/Agent.md @@ -5,25 +5,32 @@ To gather data from remote systems you can use LibreNMS in combination with chec On each of the hosts you would like to use the agent on then you need to do the following: - - Copy the check_mk_agent script into /usr/bin/ and make it executable. +* Copy the `check_mk_agent` script into `/usr/bin` and make it executable. - cp scripts/check_mk_agent /usr/bin/check_mk_agent - chmod +x /usr/bin/check_mk_agent +```shell +cp scripts/check_mk_agent /usr/bin/check_mk_agent +chmod +x /usr/bin/check_mk_agent +``` - - Copy the xinetd config file into place. +* Copy the xinetd config file into place. - cp scripts/check_mk_xinetd /etc/xinetd.d/check_mk +```shell +cp scripts/check_mk_xinetd /etc/xinetd.d/check_mk +``` - - Make the relevant directories. +* Create the relevant directories. - mkdir -p /usr/lib/check_mk_agent/plugins /usr/lib/check_mk_agent/local +```shell +mkdir -p /usr/lib/check_mk_agent/plugins /usr/lib/check_mk_agent/local +``` - - Copy each of the scripts from scripts/agent-local/ into /usr/lib/check_mk_agent/local +* Copy each of the scripts from `scripts/agent-local/` into `/usr/lib/check_mk_agent/local` +* And restart xinetd. - - Now restart xinetd. +```shell +/etc/init.d/xinetd restart +``` - /etc/init.d/xinetd restart - - - Login to the LibreNMS web interface and edit the device you want to monitor. Under the modules section, ensure that unix-agent is enabled. - - Then under Applications, enable the apps that you plan to monitor. - - Wait, in around 10 minutes you should start seeing data in your graphs under Apps for the device. +* Login to the LibreNMS web interface and edit the device you want to monitor. Under the modules section, ensure that unix-agent is enabled. +* Then under Applications, enable the apps that you plan to monitor. +* Wait, in around 10 minutes you should start seeing data in your graphs under Apps for the device. diff --git a/doc/Billing_Module.md b/doc/Billing_Module.md index 164425909..4654b8f41 100644 --- a/doc/Billing_Module.md +++ b/doc/Billing_Module.md @@ -1,10 +1,18 @@ +# Billing Module + To enable and use the billing module you need to perform the following steps: -Edit config.php and add (or enable) the following line near the end of the config - $config['enable_billing'] = 1; # Enable Billing +Edit `config.php` and add (or enable) the following line near the end of the config -Edit /etc/cron.d/librenms and add the following: - */5 * * * * root /opt/librenms/poll-billing.php >> /dev/null 2>&1 - 01 * * * * root /opt/librenms/billing-calculate.php >> /dev/null 2>&1 +```php +$config['enable_billing'] = 1; # Enable Billing +``` + +Edit `/etc/cron.d/librenms` and add the following: + +```bash +*/5 * * * * root /opt/librenms/poll-billing.php >> /dev/null 2>&1 +01 * * * * root /opt/librenms/billing-calculate.php >> /dev/null 2>&1 +``` Create billing graphs as required. diff --git a/doc/DEVEL.md b/doc/DEVEL.md index 8ed04ea5d..e4d8e31be 100644 --- a/doc/DEVEL.md +++ b/doc/DEVEL.md @@ -9,7 +9,7 @@ that has LibreNMS already running on it! To get started, you can just copy the script from `/contrib/dev_init`, or you can enter the following commands into your shell: -``` +```bash mkdir -p dev/librenms && cd $_ curl -O http://wkennedy.co/uploads/librenms/Vagrantfile curl -O http://wkennedy.co/uploads/librenms/bootstrap.sh diff --git a/doc/INSTALL.md b/doc/INSTALL.md index d35ccb2ae..7b7da82e1 100644 --- a/doc/INSTALL.md +++ b/doc/INSTALL.md @@ -14,13 +14,15 @@ Input the MySQL root password to enter the MySQL command-line interface. Create the database: - CREATE DATABASE librenms; - GRANT ALL PRIVILEGES ON librenms.* - TO 'librenms'@'' - IDENTIFIED BY '' - ; - FLUSH PRIVILEGES; - exit +```sql +CREATE DATABASE librenms; +GRANT ALL PRIVILEGES ON librenms.* + TO 'librenms'@'' + IDENTIFIED BY '' +; +FLUSH PRIVILEGES; +exit +``` Replace `` above with the IP or DNS name of the server running LibreNMS. If your database is on the same server as LibreNMS, you can use `localhost`. @@ -85,17 +87,19 @@ First, create and chown the `rrd` directory and create the `logs` directory: Next, add the following to `/etc/apache2/sites-available/librenms.conf`: - - DocumentRoot /opt/librenms/html/ - ServerName librenms.example.com - CustomLog /opt/librenms/logs/access_log combined - ErrorLog /opt/librenms/logs/error_log - AllowEncodedSlashes On - - AllowOverride All - Options FollowSymLinks MultiViews - - +```apache + + DocumentRoot /opt/librenms/html/ + ServerName librenms.example.com + CustomLog /opt/librenms/logs/access_log combined + ErrorLog /opt/librenms/logs/error_log + AllowEncodedSlashes On + + AllowOverride All + Options FollowSymLinks MultiViews + + +``` If you are running Apache 2.2.18 or higher then change AllowEncodedSlashes to NoDecode diff --git a/doc/INSTALL_LIGHTTPD.md b/doc/INSTALL_LIGHTTPD.md index 9d183550c..1673b7e13 100644 --- a/doc/INSTALL_LIGHTTPD.md +++ b/doc/INSTALL_LIGHTTPD.md @@ -11,13 +11,15 @@ Enter the MySQL root password to enter the MySQL command-line interface. Create database. - CREATE DATABASE librenms; - GRANT ALL PRIVILEGES ON librenms.* - TO 'librenms'@'' - IDENTIFIED BY '' - ; - FLUSH PRIVILEGES; - exit +```sql +CREATE DATABASE librenms; +GRANT ALL PRIVILEGES ON librenms.* + TO 'librenms'@'' + IDENTIFIED BY '' +; +FLUSH PRIVILEGES; +exit +``` Replace `` above with the IP of the server running LibreNMS. If your database is on the same server as LibreNMS, you can just use `localhost` as the IP address. diff --git a/doc/INSTALL_RHEL.md b/doc/INSTALL_RHEL.md index 73dea7292..f2d2c096a 100644 --- a/doc/INSTALL_RHEL.md +++ b/doc/INSTALL_RHEL.md @@ -16,13 +16,15 @@ Enter the MySQL root password to enter the MySQL command-line interface. Create database. - CREATE DATABASE librenms; - GRANT ALL PRIVILEGES ON librenms.* - TO 'librenms'@'' - IDENTIFIED BY '' - ; - FLUSH PRIVILEGES; - exit +```sql +CREATE DATABASE librenms; +GRANT ALL PRIVILEGES ON librenms.* + TO 'librenms'@'' + IDENTIFIED BY '' +; +FLUSH PRIVILEGES; +exit +``` Replace `` above with the IP of the server running LibreNMS. If your database is on the same server as LibreNMS, you can just use `localhost` as the IP address. @@ -57,17 +59,19 @@ Set `httpd` to start on system boot. Next, add the following to `/etc/httpd/conf.d/librenms.conf` - - DocumentRoot /opt/librenms/html/ - ServerName librenms.example.com - CustomLog /opt/librenms/logs/access_log combined - ErrorLog /opt/librenms/logs/error_log - AllowEncodedSlashes On - - AllowOverride All - Options FollowSymLinks MultiViews - - +```apache + + DocumentRoot /opt/librenms/html/ + ServerName librenms.example.com + CustomLog /opt/librenms/logs/access_log combined + ErrorLog /opt/librenms/logs/error_log + AllowEncodedSlashes On + + AllowOverride All + Options FollowSymLinks MultiViews + + +``` If you are running Apache 2.2.18 or higher then change `AllowEncodedSlashes` to `NoDecode` @@ -87,29 +91,31 @@ Modify permissions and configuration for `php-fpm` to use nginx credentials. Add configuration for `nginx` at `/etc/nginx/conf.d/librenms` with the following content: - server { - listen 80; - server_name librenms.example.com; - root /opt/librenms/html; - index index.php; - access_log /opt/librenms/logs/access_log; - error_log /opt/librenms/logs/error_log; - location / { - try_files $uri $uri/ @librenms; - } - location ~ \.php { - include fastcgi.conf; - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_pass unix:/var/run/php5-fpm.sock; - } - location ~ /\.ht { - deny all; - } - location @librenms { - rewrite ^api/v0(.*)$ /api_v0.php/$1 last; - rewrite ^(.+)$ /index.php/$1 last; - } - } +```nginx +server { + listen 80; + server_name librenms.example.com; + root /opt/librenms/html; + index index.php; + access_log /opt/librenms/logs/access_log; + error_log /opt/librenms/logs/error_log; + location / { + try_files $uri $uri/ @librenms; + } + location ~ \.php { + include fastcgi.conf; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass unix:/var/run/php5-fpm.sock; + } + location ~ /\.ht { + deny all; + } + location @librenms { + rewrite ^api/v0(.*)$ /api_v0.php/$1 last; + rewrite ^(.+)$ /index.php/$1 last; + } +} +``` ### Cloning ###