“pages” provide the opportunity to collect graphs of different hosts/services on one page. That way - as an example - you can display the traffic rates of all tape libraries. Regular expressions are possible so you can accomplish a lot with only few definitions - provided that you have appropriate names. The directory specified using “$conf['page_dir']” contains one or more file with the extension ”.cfg”.
Comments start with a hash-sign (#) and are possible within lines as well. Each file contains a “page” definition which specifies the name of the page and it determines whether the following graph definition contains regular expressions or not.
The description behind page_name
appears in the list of available pages and will be used as title of the browser window. Attention: “host_name” and “service_desc” refer to the name of the file in the perfdata directory, not to the definition in Nagios. Blanks are replaced by underscores (_).
define page { use_regex 1 # 0 = use no regular expressions, 1 = use regular expressions page_name test-page # page description }
One or more “graph” definitions follow:
define graph { host_name host1,host2,host3 service_desc Current_Load }
Attention: The list of host name will only work if you use regex 0
!
define graph { host_name host4 service_desc Current_Users }
And now some definitions with regular expressions. At first all hosts whose names are starting with “Tape”:
define graph { host_name ^Tape service_desc Traffic }
all hosts whose names are ending with “00”:
define graph { host_name 00$ service_desc Load }
all services of localhost whose names contain “a” or “o”, respectively:
define graph { host_name localhost service_desc a|o }
all services whose names contain an underscore followed by (at least) three digits on all hosts whose names start with “UX”:
define graph { host_name ^UX service_desc _\d{3} }
In some cases you may want to limit the display to just one graph. To accomplish this you can use the optional directive “source” followed by a number specifying the position within the RRD file starting at 0
define graph { host_name host1,host2,host3 service_desc PING source 1 }