report2 pnp_export

135 views
Skip to first unread message

Davide Cecchetto

unread,
Mar 27, 2013, 5:08:37 AM3/27/13
to th...@googlegroups.com
Is possible to skip the export when the graph non exist?

actually if not exist the Host Perfdata on the report i found an empty rectangle.

Davide
pnp_null.png

Sven Nierlein

unread,
Mar 27, 2013, 5:30:46 AM3/27/13
to th...@googlegroups.com
I just uploaded the 1.66 release (accouncement will follow) could you try if this is
already fixed. Because i think i fixed that already.

Sven

Davide Cecchetto

unread,
Mar 27, 2013, 5:40:27 AM3/27/13
to th...@googlegroups.com
i confirm that not working, in my test use version 1.66 and SLA_Hostgroups:
on the host without the Host Perfdata on the report i found an empty rectangle. 

Davide

Sven Nierlein

unread,
Mar 27, 2013, 7:21:34 PM3/27/13
to th...@googlegroups.com
On 3/27/13 10:40, Davide Cecchetto wrote:
> i confirm that not working, in my test use version 1.66 and SLA_Hostgroups:
> on the host without the Host Perfdata on the report i found an empty rectangle.


I cannot reproduce that. The image will only be included in the report if it exists.
The only possible reason i could imagine is, that the get_pnp_image() function returns
a image, but a corrupt/broken image which then won't be displayed. How does the html
preview of that report look like, is there a image tag in the source?

Sven

Davide Cecchetto

unread,
Mar 28, 2013, 7:24:46 AM3/28/13
to th...@googlegroups.com

Hi Sven,
I have attached the html report.
davide_davide SLA_Hostgroup.htm

Davide Cecchetto

unread,
Mar 28, 2013, 8:42:29 AM3/28/13
to th...@googlegroups.com
i make some test of redirect the image file on another folder and i see:

-rw-r--r-- 1 apache apache  2669 Mar 28 13:14 7fNTr3Ccp0
-rw-r--r-- 1 apache apache 15860 Mar 28 13:14 fMuFLz_U0n
-rw-r--r-- 1 apache apache  2661 Mar 28 13:14 HPWLrXDC82
-rw-r--r-- 1 apache apache  2649 Mar 28 13:14 NDf62vbmnU
-rw-r--r-- 1 apache apache  2669 Mar 28 13:14 QIIgIlDnoH

the only host with "host perfdata" produce the "fMuFLz_U0n" file, the others are corrupted.

Sven Nierlein

unread,
Mar 28, 2013, 8:51:58 AM3/28/13
to th...@googlegroups.com
On 28.03.2013 13:42, Davide Cecchetto wrote:
> i make some test of redirect the image file on another folder and i see:
>
> -rw-r--r-- 1 apache apache 2669 Mar 28 13:14 7fNTr3Ccp0
> -rw-r--r-- 1 apache apache 15860 Mar 28 13:14 fMuFLz_U0n
> -rw-r--r-- 1 apache apache 2661 Mar 28 13:14 HPWLrXDC82
> -rw-r--r-- 1 apache apache 2649 Mar 28 13:14 NDf62vbmnU
> -rw-r--r-- 1 apache apache 2669 Mar 28 13:14 QIIgIlDnoH
>
> the only host with "host perfdata" produce the "fMuFLz_U0n" file, the others are corrupted.
>

Whats in those other files?

Davide Cecchetto

unread,
Mar 28, 2013, 9:17:51 AM3/28/13
to th...@googlegroups.com
# more HPWLrXDC82
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="60"; URL="image?host=davide_davide_pc-xp&srv=_HOST_&view=1&source=0&graph_width=400&gra
ph_height=100&start=1363867977&end=1364472777">
<title>Framework Error</title>
<link rel="stylesheet" type="text/css" href="/var/lib/nagios/plugins/pnp/html/media/css/common.css" />
<link rel="stylesheet" type="text/css" href="/var/lib/nagios/plugins/pnp/html/media/css/ui-smoothness/jquery-ui.css" />
<link rel="icon" type="image/ico" href="/var/lib/nagios/plugins/pnp/html/media/images/favicon.ico" />
<script type="text/javascript" src="/var/lib/nagios/plugins/pnp/html/media/js/jquery-min.js"></script>
<script type="text/javascript" src="/var/lib/nagios/plugins/pnp/html/media/js/jquery-ui.min.js"></script>
<style type="text/css">
</style>
</head>
<body>
<div class="pagebody">
<table class="body">
<tr valign="top"><td>
<div class="left ui-widget">
<div class="p2 ui-widget-header ui-corner-top">
PNP4Nagios Version 0.6.16</div>
<div class="p4 ui-widget-content ui-corner-bottom" style="width: 640px">
<div style="padding: 0pt 0.7em;" class="ui-state-error ui-corner-all">

<h3>Please check the documentation for information about the following error.</h3>
<p>XML file "/var/log/nagios/perfdata/davide_davide_pc-xp/_HOST_.xml" not found. <a href="http://docs.pnp4nagios.org/faq/6"
>Read FAQ online</a></p>
<h3>file [line]:</h3>
<p><tt>application/models/data.php <strong>[312]:</strong></tt></p>
<p>
<a href="javascript:history.back()">back</a>

</div>
</div>
</td><td>
<div class="right">

<div class="ui-widget">

<div class="p2 ui-widget-header ui-corner-top">
Actions</div>

<div class="p4 ui-widget-content ui-corner-bottom" >
<a title="back" href="javascript:history.back()"><img class="icon" src="/var/lib/nagios/plugins/pnp/html/media/images/back.
png"></a>
<a title="View Graphs" href="/var/lib/nagios/plugins/pnp/html/index.php/graph"><img class="icon" src="/var/lib/nagios/plugi
ns/pnp/html/media/images/home.png"></a>
<a title="View Documentation" href="/var/lib/nagios/plugins/pnp/html/index.php/docs"><img class="icon" src="/var/lib/nagios
/plugins/pnp/html/media/images/docs.png"></a>
</div>

</div>

</div>
</td></tr>
<tr valign="top"><td colspan="2">
<div class="left">
<div class="cb p4 ui-widget-content ui-corner-all">
Loaded in 0.0177 seconds, using 1.52MB of memory. Generated by Kohana v2.3.4.</div>
</div>
</div>
</td></tr></table>
</div>

</body>
</html>

Sven Nierlein

unread,
Mar 28, 2013, 9:43:36 AM3/28/13
to th...@googlegroups.com
This should help:
https://github.com/sni/Thruk/commit/ebc52b65b0825760d1d090fb08c89856d4944d42

Sven

On 28.03.2013 14:17, Davide Cecchetto wrote:
>
> Il giorno gioved� 28 marzo 2013 13:51:58 UTC+1, Sven Nierlein ha scritto:
>
> On 28.03.2013 13:42, Davide Cecchetto wrote:
> > i make some test of redirect the image file on another folder and i see:
> >
> > -rw-r--r-- 1 apache apache 2669 Mar 28 13:14 7fNTr3Ccp0
> > -rw-r--r-- 1 apache apache 15860 Mar 28 13:14 fMuFLz_U0n
> > -rw-r--r-- 1 apache apache 2661 Mar 28 13:14 HPWLrXDC82
> > -rw-r--r-- 1 apache apache 2649 Mar 28 13:14 NDf62vbmnU
> > -rw-r--r-- 1 apache apache 2669 Mar 28 13:14 QIIgIlDnoH
> >
> > the only host with "host perfdata" produce the "fMuFLz_U0n" file, the others are corrupted.
> >
>
> Whats in those other files?
>
> --
> You received this message because you are subscribed to the Google Groups "Thruk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to thruk+un...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Davide Cecchetto

unread,
Mar 28, 2013, 10:16:58 AM3/28/13
to th...@googlegroups.com
Thanks,
now working fine, very good job.
Another thing, if every upgrade the file reports2/templates/reports/style/custom.tt is overwritten, all the customization will be lost.
Is possible to fix this problem or remove the custom.tt from installer?

Davide

Sven Nierlein

unread,
Mar 28, 2013, 10:45:33 AM3/28/13
to th...@googlegroups.com
You need to copy custom templates in your user templates folder. Then they won't be overwritten by updates.


On 3/28/13 15:16, Davide Cecchetto wrote:
> Thanks,
> now working fine, very good job.
> Another thing, if every upgrade the file reports2/templates/reports/style/custom.tt is overwritten, all the customization will be lost.
> Is possible to fix this problem or remove the custom.tt from installer?
>
> Davide
>
> Il giorno giovedì 28 marzo 2013 14:43:36 UTC+1, Sven Nierlein ha scritto:
>
> This should help:
> https://github.com/sni/Thruk/commit/ebc52b65b0825760d1d090fb08c89856d4944d42 <https://github.com/sni/Thruk/commit/ebc52b65b0825760d1d090fb08c89856d4944d42>
>
> Sven
>
> On 28.03.2013 14:17, Davide Cecchetto wrote:
> >
> > Il giorno gioved� 28 marzo 2013 13:51:58 UTC+1, Sven Nierlein ha scritto:
> >
> > On 28.03.2013 13:42, Davide Cecchetto wrote:
> > > i make some test of redirect the image file on another folder and i see:
> > >
> > > -rw-r--r-- 1 apache apache 2669 Mar 28 13:14 7fNTr3Ccp0
> > > -rw-r--r-- 1 apache apache 15860 Mar 28 13:14 fMuFLz_U0n
> > > -rw-r--r-- 1 apache apache 2661 Mar 28 13:14 HPWLrXDC82
> > > -rw-r--r-- 1 apache apache 2649 Mar 28 13:14 NDf62vbmnU
> > > -rw-r--r-- 1 apache apache 2669 Mar 28 13:14 QIIgIlDnoH
> > >
> > > the only host with "host perfdata" produce the "fMuFLz_U0n" file, the others are corrupted.
> > >
> >
> > Whats in those other files?
> >
> > --
> > You received this message because you are subscribed to the Google Groups "Thruk" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to thruk+un...@googlegroups.com <javascript:>.
> > For more options, visit https://groups.google.com/groups/opt_out <https://groups.google.com/groups/opt_out>.

Davide Cecchetto

unread,
Mar 28, 2013, 10:50:07 AM3/28/13
to th...@googlegroups.com
Thanks,

The last problem, on  the mail boby missing space or \n:

"Your report is attached.

Hostgroup: davide_davideReport Timeperiod: 20 Mar 2013 - 27 Mar 2013
Description: Description"

Davide Cecchetto

unread,
Mar 28, 2013, 11:45:53 AM3/28/13
to th...@googlegroups.com
if "my_templates" is my "user_template_path = my_templates",
what is the right path of custom.tt?

Sven Nierlein

unread,
Mar 28, 2013, 11:50:13 AM3/28/13
to th...@googlegroups.com
On 3/28/13 16:45, Davide Cecchetto wrote:
> if "my_templates" is my "user_template_path = my_templates",
> what is the right path of custom.tt <http://custom.tt/>?

create a "reports/style" below the my_templates path and put your custom.tt inside.

Davide Cecchetto

unread,
Mar 28, 2013, 12:01:17 PM3/28/13
to th...@googlegroups.com
thank you very much!


Davide
Reply all
Reply to author
Forward
0 new messages