nagios4dd icon indicating copy to clipboard operation
nagios4dd copied to clipboard

Help pnp4nagios send service

Open mauro25987 opened this issue 7 years ago • 0 comments

Hi frank, my name is mauro and i am from uruguay. I have used the pnp4nagios plugin and it is very good job. But there is something that I can not walk, is to authenticate with the web_user and web_pass.

can you help me?

For tests using the -t/--test option, if we want to see PNP4Nagios

graphs we need to set a valid host name and service name below.

my $test_host = "amazon"; # existing host in PNP4Nagios my $test_service = "CPU"; # existing services in PNP4nagios

Here we set the URL to pick up the RRD data files for the optional graph

image generation. Modified by Robert Becht for use with PNP4Nagios.

The PNP4Nagios URL : if not used we can set $pnp4nagios_url = undef;

my $pnp4nagios_url = "http://192.168.60.3/pnp4nagios"; my $graph_history = 48; # in hours, a good range is between 12...48

If web authentication is needed, configure the access parameters below:

my $pnp4nagios_auth = "true"; my $server_port = "192.168.60.3/nagios"; my $auth_name = "Nagios Access"; my $web_user = "nagiosadmin"; my $web_pass = "asd123";

SMTP related data: If the commandline argument -H/--smtphost was not

given, we use the provided value in $o_smtphost below as the default.

If the mailserver requires auth, an example is further down the code.

my $o_smtphost = "127.0.0.1"; my $domain = "@fm4dd.com"; # this is only for -g groups my @listaddress = ();

root@tn-nagios:/usr/local/nagios# /usr/local/nagios/libexec/pnp4n_send_service_mail.pl -v -t -r [email protected] -f graph -u -l en main: trying to create the PNP4Nagios graph image. import_pnp_graph: Cannot download PNP4Nagios image file. Server response: 401 Unauthorized import_pnp_graph: Returning empty image file, format: gif

main: Sending HTML email (language: en) with inline logo. b64encode_img: completed conversion of source image file: /usr/local/nagios/share/images/logos/tn.png - main: Converted inline logo to base64 and set type to png. Use of uninitialized value $link_id in concatenation (.) or string at /usr/local/nagios/libexec/pnp4n_send_service_mail.pl line 784. Sendmail Log says: Mail::Sendmail v. 0.79_16 - Thu Jan 19 14:51:54 2017 Date: Thu, 19 Jan 2017 14:51:54 -0500 Server: 127.0.0.1 Port: 25 From: [email protected] Subject: Nagios: TEST service CPU on amazon (Linux Servers) is UNKNOWN To: [email protected]

Result: 250 2.0.0 Ok: queued as E20697FF76

He tried it in various ways and I have not managed to walk it.

mauro25987 avatar Jan 23 '17 19:01 mauro25987