Antwort: RE: MRTG graphs problem - measurement units not taken into consideration

Radu.Popa at technomatic.de Radu.Popa at technomatic.de
Sat Jul 2 14:26:56 CEST 2011



Yes, that's the one. Inside my config_local.php I have the line already
put:

#
# Use this file as PDF background.
#
$conf['background_pdf'] = '/usr/local/pnp4nagios/etc/background.pdf' ;

I downloaded the pdf file via scp and double checked to confirm it's the
modified one.

The rights on the file are:

-rw-r--r-- 1 nagios nagios 41924 Jul  2 08:39 background.pdf

Thanks!


>
> What I am trying to achieve is now modifying a bit the pdf generated page
(
> add an additional logo, put some text, aso). Saw that the background page
> is called background.pdf, so I have modified that, but when generating
PDF
> I still see the original background page, not the modified one.

Please be more precise!

which pdf file did you modify?

pnp4nagios/etc/background.pdf? Is this the one?

Is this file also registered in your pnp4nagios/etc/config_local.php

#
# Use this file as PDF background.
#
$conf['background_pdf'] = '/usr/local/pnp4nagios/etc/background.pdf' ;




Von:        Radu Popa/Technomatic
An:         nagios-users at lists.sourceforge.net
Datum:      07/02/2011 02:19 PM
Betreff:    Antwort: RE: MRTG graphs problem - measurement units not taken
            into consideration


What I am trying to achieve is now modifying a bit the pdf generated page (
add an additional logo, put some text, aso). Saw that the background page
is called background.pdf, so I have modified that, but when generating PDF
I still see the original background page, not the modified one.

Thanks!




Von:        Radu Popa/Technomatic
An:         nagios-users at lists.sourceforge.net
Datum:      07/02/2011 12:38 PM
Betreff:    Antwort: RE: MRTG graphs problem - measurement units not taken
            into consideration


PNP version is 0.6.13 and you are totally right about the config_local.php
file. Modified in that one and I see it in all graphs.

The only opened issue for now is the pdf background file.

Thanks a lot!



------------------------------------------------------------


Which pnp4nagios version do you use?

I assume its 0.6.13

PNP web interface reads config files in the following order.

pnp4nagios/etc/config_local.php
pnp4nagios/etc/config.php

config_local.php is used to store your own changes and will not be
overwritten on updates.
config.php is the default config file.

http://docs.pnp4nagios.org/pnp-0.6/webfe_cfg

Joerg





Von:        Radu Popa/Technomatic
An:         Radu Popa/Technomatic at Maxdorf
Kopie:      nagios-users at lists.sourceforge.net
Datum:      07/02/2011 12:24 PM
Betreff:    Antwort: RE: MRTG graphs problem - measurement units not taken
            into consideration


I have managed to put the text into the graphs ( watermark) by adding the
option directly into the respective php file ( e.g. check_snmp_int.php).
All the php files seem to have already an $opt[1] line which overrides the
general options.

I am still stucked with the PDF background file however.

Thanks once again!


----------------------------------------------------------------------------
I can't say I've ever tried that.  I would think you need to append to
rather than replace the graph options though, so wouldn't it be ..

  $conf['graph_opt'] .= " --watermark 'Test'"

(note the ".=" rather than just "=" and the space added before --watermark
)

I don't have my Nagios system to hand at the moment so can't take a
look myself.  Remind me on Monday if you're still stuck and I'll have
a play with that myself.

Another option is to create some graphs outside of PNP altogether (but
using the .rrd databases created by PNP).  See:

http://oss.oetiker.ch/rrdtool/doc/rrdcgi.en.html

Again, I can dig out some examples for you if you remind me during the
week (or do a search - I'm sure we've covered this topic before either
here or on the PNP email list some time in the last few months).




Von:        Radu Popa/Technomatic
An:         nagios-users at lists.sourceforge.net
Datum:      07/02/2011 09:36 AM
Betreff:    Antwort: RE: MRTG graphs problem - measurement units not taken
            into consideration


Hello again,

Can you please give some guidelines how to customize the PNP4Nagios
background page? I have tried using the $conf['graph_opt'] = "--watermark
'Test'" option, but it does not take it. Also modifications done on the
background.pdf file are not updated. Already restarted apache and nagios
services. In general I would like to add some logos and/or text.

Thank you!

On 29 June 2011 13:23,  <Radu.Popa at ...> wrote:
> After adding the -r option it works like a charm!
>
> Now in pnp4nagios I can see both values on the same graph: bytes in and
> bytes out. I see them as two thin lines. Any way to make the lines
thicker
> and change their colour?

Well done.

Yes, you can create a custom template.

Take a look under /usr/local/pnp4nagios/share/templates.dist and find
the file named check_snmp_int.php .  Copy it to the directory
/usr/local/pnp4nagios/share/templates and then edit it to get the
wider line.

For example the line which reads:

$def[1] .= "LINE1:var1#003300:\"in  \" " ;

Change it to read:

$def[1] .= "LINE3:var1#003300:\"in  \" " ;



You will find documentation on how the LINE instruction works at:

http://oss.oetiker.ch/rrdtool/doc/rrdgraph_graph.en.html

and some general help on PNP templates at:

http://docs.pnp4nagios.org/pnp-0.6/tpl




Von:        Radu Popa/Technomatic
An:         nagios-users at lists.sourceforge.net
Datum:      06/29/2011 03:23 PM
Betreff:    Antwort: RE: MRTG graphs problem - measurement units not taken
            into consideration


After adding the -r option it works like a charm!

Now in pnp4nagios I can see both values on the same graph: bytes in and
bytes out. I see them as two thin lines. Any way to make the lines thicker
and change their colour?




Von:        Radu Popa/Technomatic
An:         nagios-users at lists.sourceforge.net
Datum:      06/29/2011 01:45 PM
Betreff:    Antwort: RE: MRTG graphs problem - measurement units not taken
            into consideration


Was a typo error of the community string, after putting "public" instead of
"Public" everything looks cool.

Still 1 question:

If I try to query interface GigabitEthernet0/2 I get the response:

GigabitEthernet0/21:DOWN, GigabitEthernet0/23:DOWN, GigabitEthernet0/24:UP
No usable data on file (40 rows) , GigabitEthernet0/2:UP No usable data on
file (1 rows) , GigabitEthernet0/22:DOWN, GigabitEthernet0/20:UP No usable
data on file (1 rows) : 3 int NOK : CRITICAL

So ti seems that it takes all interfaces starting with "0/2" string. Any
way to limit this? Do I have to enter any escape character?

Thank you!




Von:        Radu Popa/Technomatic
An:         nagios-users at lists.sourceforge.net
Datum:      06/29/2011 01:29 PM
Betreff:    Antwort: RE: MRTG graphs problem - measurement units not taken
            into consideration


Ok,

Here is what I got so far:

1. If I run the command: ./check_snmp_int.pl -H 192.168.2.1 -C public -2 -n
GigabitEthernet0/24 -fY -kqB -g -w 600000,600000,100,100,100000,10 -c
800000,800000,200,200,200000,20 -d 5 , I get the following output:
GigabitEthernet0/24:UP (16.9Kbps/26.2Kbps/0.0/0.0/0.0/0.0):1 UP: OK |
'GigabitEthernet0/24_in_bps'=16899;600000000;800000000;0;1000000000
'GigabitEthernet0/24_out_bps'=26237;600000000;800000000;0;1000000000

Before getting a correct output I run the command several times. The
initial output is GigabitEthernet0/24:UP No usable data on file (102 rows)
:(1 UP): UNKNOWN

2. Defined the following command in nagios:

define command{
        command_name    check_snmp_int
        command_line    $USER1$/check_snmp_int.pl -H $HOSTADDRESS$ -C
$USER5$ -2 -n $ARG1$ -fY -kqB -g -w $ARG2$ -c $ARG3$ -d $ARG4$
        }

Where

And the corresponding service check:

define service{
        use                     generic-service,pnpgraphed-service      ;
Inherit values from a template
        host_name               test_sw
        service_description     Port 24 Bandwidth Usage
        check_command
check_snmp_int!"GigabitEthernet0/24"!600000,600000,100,100,100000,10!800000,800000,200,200,200000,20!10
        normal_check_interval   2               ; Check the service every 2
units under normal conditions
        retry_check_interval    1               ; Re-check the service
every 1 unit until its final/hard state is determined
        }

In nagios service status I get now: ERROR: Description table : No response
from remote host "192.168.2.1".

In resources I have defined $USER5$=Public

Ideas, please?

Thank you!



Von:        Radu Popa/Technomatic
An:         nagios-users at lists.sourceforge.net
Datum:      06/28/2011 05:14 PM
Betreff:    RE: MRTG graphs problem - measurement units not taken into
            consideration


I have tried the SNMP plugin a few minutes ago and here is what I get when
running it from the command line:

./check_snmp_int.pl -H 192.168.2.1 -C public -n GigabitEthernet0/24 -k -w
200,400 -c 0,600
GigabitEthernet0/24:UP No usable data on file (1 rows) :(1 UP): UNKNOWN

The interface name I took it from listing all available interfaces on the
switch.

Any ideas, please?

Thanks!




Von:        Radu Popa/Technomatic
An:         nagios-users at lists.sourceforge.net
Datum:      06/28/2011 03:31 PM
Betreff:    MRTG graphs problem - measurement units not taken into
            consideration


Hello,

I am using Nagios to monitor the bandwidth usage of a couple of
switches/routers via the check_local_mrtgtraf command. The graphs I handle
via pnp4nagios. The problem I encounter is the following: if the monitored
bandwidth is at one point expressed in KB/s and then I bring a lot of
traffic through the router the, unit is changed into MB/s. The graphed
values seem not to take into consideration the change of the measurement
unit meaning that the 50KB/s seems to be at the same height as the 50MB/s
value in the graph.

Can anyone please help?

Thank you!


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list