1 | nagiosgraph Installation |
---|
2 | ------------------------ |
---|
3 | |
---|
4 | File: $Id: INSTALL,v 1.14 2006/04/05 12:37:11 sauber Exp $ |
---|
5 | Author: (c) Soren Dossing, 2005 |
---|
6 | License: OSI Artistic License |
---|
7 | http://www.opensource.org/licenses/artistic-license.php |
---|
8 | |
---|
9 | Follow instructions below to install and use nagiosgraph. The |
---|
10 | instructions are for Nagios 2.0b4, and might differ in other versions of |
---|
11 | Nagios. |
---|
12 | |
---|
13 | - Check required packaged are installed: perl, CGI, nagios and rrdtool |
---|
14 | |
---|
15 | - Install nagiosgraph.conf, map, insert.pl and show.cgi somewhere, for |
---|
16 | example in /usr/local/nagios/nagiosgraph/ |
---|
17 | |
---|
18 | - Edit paths, debug level etc. in nagiosgraph.conf. |
---|
19 | |
---|
20 | - Check that nagios user can write to rrd dir, and www user can read. |
---|
21 | |
---|
22 | - Check that nagios and www user can write to log file. |
---|
23 | |
---|
24 | - In insert.pl and show.cgi edit path to nagiosgraph.conf file. |
---|
25 | |
---|
26 | - In nagios.cfg set: |
---|
27 | |
---|
28 | process_performance_data=1 |
---|
29 | service_perfdata_file=/var/spool/nagios/perfdata.log |
---|
30 | service_perfdata_file_template=$LASTSERVICECHECK$||$HOSTNAME$||$SERVICEDESC$||$SERVICEOUTPUT$||$SERVICEPERFDATA$ |
---|
31 | service_perfdata_file_mode=a |
---|
32 | service_perfdata_file_processing_interval=30 |
---|
33 | service_perfdata_file_processing_command=process-service-perfdata |
---|
34 | |
---|
35 | Make sure that service_perfdata_command is not defined. |
---|
36 | |
---|
37 | Make sure that location of perfdata_file matches definition in |
---|
38 | nagiosgraph.conf . |
---|
39 | |
---|
40 | - In checkcommands.cfg or misccommands.cfg: |
---|
41 | |
---|
42 | define command { |
---|
43 | command_name process-service-perfdata |
---|
44 | command_line /usr/local/nagios/nagiosgraph/insert.pl |
---|
45 | } |
---|
46 | |
---|
47 | Make sure there is only one definition for process-service-perfdata. |
---|
48 | |
---|
49 | - Alternative to the two points above: The old style is still possible. |
---|
50 | It uses far more CPU but inserts data in rrd files immediately for |
---|
51 | every service check. |
---|
52 | |
---|
53 | In nagios.cfg: |
---|
54 | |
---|
55 | service_perfdata_command=process-service-perfdata |
---|
56 | |
---|
57 | Make sure that service_perfdata_file_processing_command is not |
---|
58 | defined. |
---|
59 | |
---|
60 | In misccommands.cfg: |
---|
61 | |
---|
62 | define command{ |
---|
63 | command_name process-service-perfdata |
---|
64 | command_line /usr/local/nagios/nagiosgraph/insert.pl "$LASTSERVICECHECK$||$HOSTNAME$||$SERVICEDESC$||$SERVICEOUTPUT$||$SERVICEPERFDATA$" |
---|
65 | } |
---|
66 | |
---|
67 | - Put an icon approx. 40x40 in .../share/images/logos/ for nagios to link |
---|
68 | to graphs. |
---|
69 | |
---|
70 | - Copy nagiosgraph.css to .../nagios/stylesheets/ . |
---|
71 | |
---|
72 | - In cgi.cfg have: |
---|
73 | |
---|
74 | xedtemplate_config_file=/usr/local/etc/nagios/serviceextinfo.cfg |
---|
75 | |
---|
76 | - Edit serviceextinfo.cfg |
---|
77 | |
---|
78 | Most services can be graphed with no particular configuration like this: |
---|
79 | |
---|
80 | define serviceextinfo { |
---|
81 | service_description DNS |
---|
82 | hostgroup servers |
---|
83 | notes_url /nagiosgraph/show.cgi?host=$HOSTNAME$&service=$SERVICEDESC$ |
---|
84 | icon_image graph.gif |
---|
85 | icon_image_alt View graphs |
---|
86 | } |
---|
87 | |
---|
88 | Instead of hostgroup line a host_name line with all hosts where this |
---|
89 | type of data are being collected. |
---|
90 | |
---|
91 | Some type of services have data values that have big differences in the |
---|
92 | magnitude. In such cases it's good idea to split up into seperate |
---|
93 | graphs. Here's an example for ntp: |
---|
94 | |
---|
95 | define serviceextinfo { |
---|
96 | service_description NTP |
---|
97 | host_name server01,server02,server03,server04 |
---|
98 | notes_url /nagiosgraph/show.cgi?host=$HOSTNAME$&service=$SERVICEDESC$&db=ntp,jitter,offset&db=ntp,stratum |
---|
99 | icon_image graph.gif |
---|
100 | icon_image_alt View graphs |
---|
101 | } |
---|
102 | |
---|
103 | - Add for example &geom=350x100 to notes_url line for custom sizes of |
---|
104 | graphs. |
---|
105 | |
---|
106 | - Add for example &rrdopts=%2Dl%200%20%2Du%20100 (meaning: |
---|
107 | "-l 0 -u 100") to notes_url line for custom Y axis ranges. Any |
---|
108 | rrdgraph options can be specified, but has to be url encoded. |
---|
109 | |
---|
110 | - Configure Apache to point to show.cgi. For example: |
---|
111 | |
---|
112 | ScriptAlias /nagiosgraph/ /usr/local/nagios/nagiosgraph/ |
---|
113 | |
---|
114 | - To add new service types, edit the map file. This contains regular |
---|
115 | expression to identify service types, and defines how to store data in |
---|
116 | rrd files. Use testentry.pl for testing before inserting in map file. |
---|
117 | |
---|
118 | - Consider security. |
---|
119 | |
---|
120 | - Start Nagios. Increase debug level in nagiosgraph.conf if things don't |
---|
121 | work right away. |
---|
122 | |
---|
123 | - Keep an eye on the log file. It can grow big. Perhaps rotate it, or |
---|
124 | decrease log level when everything works fine. |
---|