Page 1 of 1

How to create pages for pnp4nagios graphs

Posted: Thu Sep 28, 2017 4:44 am
by roeseler
Hello.

I'm trying to create pages in pnp4nagios that should contain only one graph. For instance, I have a switch that has a graph for an interface usage 'in' and another graph for 'out'; I would like to have a page that only contains the 'in' usage graph and another page for the 'out' usage graph, so that I can have them rotating in a monTV.
I don't now if it is possible to create the pages with the GUI so I created them manually in the folder /etc/pnp4nagios/pages and added the following content:

Code: Select all

#
# Sample Page Config
#
# Global Section
# use_regex [0|1]
# page_name < your page title >
# background_pdf <pdf file>

define  page  {
        use_regex 1
        page_name switch1-nwc-interface-usage-wan1-in
}

#
# Define the first Graph
#
define graph {
        host_name       switch1        # Every host starting with 'websrv'
        service_desc    interface-usage-wan1-in      # Every service starting with 'traffic'
        source          1             # OPTIONAL Show only the first image
}

When I open the page I get the following error:
Alert: ERROR: Sorry, but we can“t find any data using config file "switch1.cfg", Read FAQ online
Any help would be appreciated.

Cheers!

Re: How to create pages for pnp4nagios graphs

Posted: Thu Sep 28, 2017 9:43 am
by roeseler
Just to add that I found the root cause. The service_desc was not matching the file name at /var/lib/pnp4nagios/perfdata on the host's folder.
Everything working now!

Cheers!

Re: How to create pages for pnp4nagios graphs

Posted: Thu Sep 28, 2017 10:09 am
by kyang
Sounds great! I'll be closing this topic as resolved! Thanks for posting the answer!

If you have any more questions, feel free to create another thread!

Thank you for using the Nagios Support Forums!