no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
| — | tech:linux:pnp4nagios [2018/12/06 12:27] (current) – created - external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Setting up pnp4nagios on Ubuntu 12.04 LTS Precise Pangolin ====== | ||
| + | ===== Prerequisites ===== | ||
| + | nagios3 is installed. | ||
| + | |||
| + | ===== Install ===== | ||
| + | < | ||
| + | aptitude install pnp4nagios | ||
| + | </ | ||
| + | |||
| + | ===== Configuring Bulk Mode with NPCD ===== | ||
| + | ==== nagios.cfg ==== | ||
| + | In / | ||
| + | <code bash> | ||
| + | grep process_performance_data / | ||
| + | sed -i ' | ||
| + | </ | ||
| + | |||
| + | Create the following directories where the performance data will be stored | ||
| + | <code bash> | ||
| + | mkdir -p / | ||
| + | chown -R nagios: | ||
| + | </ | ||
| + | |||
| + | Configure nagios.cfg to use the directories and files for storing the data | ||
| + | <code ini> | ||
| + | # | ||
| + | # service performance data | ||
| + | # | ||
| + | service_perfdata_file=/ | ||
| + | service_perfdata_file_template=DATATYPE:: | ||
| + | service_perfdata_file_mode=a | ||
| + | service_perfdata_file_processing_interval=15 | ||
| + | service_perfdata_file_processing_command=pnp-bulk-service | ||
| + | |||
| + | # | ||
| + | # host performance data | ||
| + | # | ||
| + | host_perfdata_file=/ | ||
| + | host_perfdata_file_template=DATATYPE:: | ||
| + | host_perfdata_file_mode=a | ||
| + | host_perfdata_file_processing_interval=15 | ||
| + | host_perfdata_file_processing_command=pnp-bulk-host | ||
| + | # | ||
| + | </ | ||
| + | |||
| + | conf.d/ | ||
| + | ''/ | ||
| + | |||
| + | < | ||
| + | define command { | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | |||
| + | define command { | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | |||
| + | ############################################################################## | ||
| + | |||
| + | define command{ | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | |||
| + | define command{ | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | |||
| + | ############################################################################## | ||
| + | |||
| + | define command{ | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | |||
| + | define command{ | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Config pnp4nagios ==== | ||
| + | * Edit / | ||
| + | * Update: RUN=" | ||
| + | * Validate: / | ||
| + | * No change usually required | ||
| + | |||
| + | |||
| + | ===== Apache web server configuration ===== | ||
| + | Link the pnp4nagios web configuration to apache configuration | ||
| + | <code bash> | ||
| + | ln -s / | ||
| + | service apache2 restart | ||
| + | </ | ||
| + | |||
| + | ===== Restart ===== | ||
| + | Restart services | ||
| + | <code bash> | ||
| + | service nagios3 restart | ||
| + | service npcd start | ||
| + | service apache2 restart | ||
| + | </ | ||
| + | |||
| + | ===== Use ===== | ||
| + | http:// | ||
| + | |||
| + | |||
| + | ===== Optional ===== | ||
| + | In / | ||
| + | < | ||
| + | log_type = file | ||
| + | #log_type = syslog | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Errors ===== | ||
| + | Common errors are when monitoring parameters change in nagios and the old XML definitions have to be deleted. | ||
| + | <code bash> | ||
| + | grep -R "found extra data" / | ||
| + | </ | ||
| + | For the related dot xml file, delete both the dot rrd (and the dot xml) file. For example if you get the output as | ||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | then delete as follows | ||
| + | <code bash> | ||
| + | rm / | ||
| + | </ | ||
| + | Of course this means you lose historical data as well. | ||
| + | |||
| + | Alternative grep to check for other errors/ | ||
| + | <code bash> | ||
| + | grep -R TXT / | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Cron job for error check ===== | ||
| + | Create / | ||
| + | <code bash> | ||
| + | #!/bin/bash | ||
| + | # | ||
| + | PNP4LOC=/ | ||
| + | # | ||
| + | PNPERRCNT=`grep -R TXT $PNP4LOC/ | ||
| + | if [ $PNPERRCNT -gt 0 ]; then | ||
| + | grep -R TXT $PNP4LOC/ | ||
| + | fi | ||
| + | # | ||
| + | exit | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Increasing RRD Resolution ===== | ||
| + | The ''/ | ||
| + | |||
| + | Sometimes this file is at ''/ | ||
| + | |||
| + | Sometimes this file is referenced from ''/ | ||
| + | |||
| + | ==== High Resolution ==== | ||
| + | < | ||
| + | # | ||
| + | # Define the default RRA Step in seconds | ||
| + | # More Infos on | ||
| + | # http:// | ||
| + | # | ||
| + | RRA_STEP=60 | ||
| + | # | ||
| + | # PNP default RRA config | ||
| + | # | ||
| + | # you will get 6 MB of data per datasource | ||
| + | # | ||
| + | # 51840 entries with 1 minute step = 36 days | ||
| + | # | ||
| + | RRA: | ||
| + | # | ||
| + | # 115200 entries with 5 minute step = 400 days | ||
| + | # | ||
| + | RRA: | ||
| + | # | ||
| + | # 38400 entries with 30 minute step = 800 days | ||
| + | # | ||
| + | RRA: | ||
| + | # | ||
| + | # 35040 entries with 60 minute step = 4 years | ||
| + | # | ||
| + | RRA: | ||
| + | |||
| + | RRA: | ||
| + | RRA: | ||
| + | RRA: | ||
| + | RRA: | ||
| + | |||
| + | RRA: | ||
| + | RRA: | ||
| + | RRA: | ||
| + | RRA: | ||
| + | </ | ||
| + | |||
| + | ==== Medium Resolution ==== | ||
| + | < | ||
| + | # | ||
| + | # Define the default RRA Step in seconds | ||
| + | # More Infos on | ||
| + | # http:// | ||
| + | # | ||
| + | RRA_STEP=60 | ||
| + | # | ||
| + | # PNP default RRA config | ||
| + | # | ||
| + | # you will get 2.8 MB of data per datasource | ||
| + | # | ||
| + | # 11520 entries with 1 minute step = 8 days | ||
| + | # | ||
| + | RRA: | ||
| + | # | ||
| + | # 11520 entries with 5 minute step = 40 days | ||
| + | # | ||
| + | RRA: | ||
| + | # | ||
| + | # 19200 entries with 30 minute step = 400 days | ||
| + | # | ||
| + | RRA: | ||
| + | # | ||
| + | # 17520 entries with 120 minute step = 4 years | ||
| + | # | ||
| + | RRA: | ||
| + | |||
| + | RRA: | ||
| + | RRA: | ||
| + | RRA: | ||
| + | RRA: | ||
| + | |||
| + | RRA: | ||
| + | RRA: | ||
| + | RRA: | ||
| + | RRA: | ||
| + | </ | ||
| + | |||
| + | ==== Low Resolution ==== | ||
| + | The default resolution you get on install. | ||
| + | < | ||
| + | # | ||
| + | # Define the default RRA Step in seconds | ||
| + | # More Infos on | ||
| + | # http:// | ||
| + | # | ||
| + | RRA_STEP=60 | ||
| + | # | ||
| + | # PNP default RRA config | ||
| + | # | ||
| + | # you will get 400kb of data per datasource | ||
| + | # | ||
| + | # 2880 entries with 1 minute step = 48 hours | ||
| + | # | ||
| + | RRA: | ||
| + | # | ||
| + | # 2880 entries with 5 minute step = 10 days | ||
| + | # | ||
| + | RRA: | ||
| + | # | ||
| + | # 4320 entries with 30 minute step = 90 days | ||
| + | # | ||
| + | RRA: | ||
| + | # | ||
| + | # 5840 entries with 360 minute step = 4 years | ||
| + | # | ||
| + | RRA: | ||
| + | |||
| + | RRA: | ||
| + | RRA: | ||
| + | RRA: | ||
| + | RRA: | ||
| + | |||
| + | RRA: | ||
| + | RRA: | ||
| + | RRA: | ||
| + | RRA: | ||
| + | </ | ||
| + | |||
| + | ===== Performance Data Format ===== | ||
| + | Format | ||
| + | < | ||
| + | ' | ||
| + | </ | ||
| + | |||
| + | Example showing multiple data sources | ||
| + | < | ||
| + | Access Count is OK. Response Time is OK. HTTP 2xx Count is OK. HTTP 3xx Count is OK. HTTP 4xx Count is OK. HTTP 5xx Count is OK. Access Count=23 Response Time=179357us HTTP 2xx Count=13 HTTP 3xx Count=10 HTTP 4xx Count=0 HTTP 5xx Count=0|' | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Performance Data Custom Graphs ===== | ||
| + | You can customize data graphs by creating a custom php template and naming it appropriately. The naming convention is to use the same name (with .php extension) as used by the Nagios command. | ||
| + | |||
| + | Also refer to [[http:// | ||
| + | |||
| + | ===== Other ===== | ||
| + | * [[pnp4nagios_averages|pnp4nagios extracting averages]] | ||
| + | * [[pnp4nagios_graphs|pnp4nagios extracting graphs]] | ||
| + | * [[http:// | ||
| + | |||
| + | |||
| + | |||