Giter VIP home page Giter VIP logo

nagios4dd's Introduction

Welcome

I enjoy designing and building electronics hardware (development boards), and learning how to code low-level. I have been working on FPGA PMOD design, on solar position tracking for photovoltaic systems, and with a long work history in Information Security some repos are security-related.

Frank's github statsTop Langs

nagios4dd's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

nagios4dd's Issues

Cannot download PNP4Nagios image file. Server response: 500 Can't connect to hostname

Hello!
When i try send "graph" from pnp4nagios (https://hostname/pnp4nagios)
script get error:
Cannot download PNP4Nagios image file. Server response: 500 Can't connect to hostname:443

All variables set in
my $pnp4nagios_auth = "true"; # $pnp4nagios_auth = "true";
my $server_port = "hostname:443"; # $server_port = "nagios.frank4dd.com:80";
my $auth_name = "Nagios Access"; # $auth_name = "pnp4nagios";
my $web_user = "pnp4nget"; # $web_user = "pnp4nget";
my $web_pass = "P@ssw0rd"; # $web_pass = "mypass";

And little change URL:
#$img_get = "$pnp4nagios_url/image?host=" . urlencode($o_hostname) . "&srv=" . urlencode($o_servicedesc) . "&source=0&start=$tstart&end=$tstamp"; $img_get = "$pnp4nagios_url/graph?host=" . urlencode($o_hostname) . "&srv=" . urlencode($o_servicedesc) . "&source=0&start=$tstart&end=$tstamp";
In debug eMail, when i get it, link to graph right. In browser i get it.

img_get | https://hostname/pnp4nagios/graph?host=hostname&srv=Total_Processes&source=0&start=1508344713&end=1508434713

Why you used "=>" ? vs ", "
# Check if web authentication is required if (defined($pnp4nagios_auth)) { $ua->credentials("$server_port", "$auth_name", "$web_user" => "$web_pass"); }

http://search.cpan.org/~benning/LWP-Protocol-connect-6.09/lib/LWP/Protocol/connect.pm
$ua->credentials("localhost:3128", "Squid proxy-caching web server", "user", "pw");
3.10.0-693.2.1.el7.x86_64 #1 SMP Fri Aug 11 04:58:43 EDT 2017 x86_64
OEL 7.4
rpm -qa | egrep 'LWP|IO'
perl-LWP-Protocol-https-6.04-4.el7.noarch
perl-IO-Socket-SSL-1.94-6.el7.noarch
perl-IO-Socket-INET6-2.69-5.el7.noarch
perl-LWP-MediaTypes-6.02-2.el7.noarch
perl-IO-HTML-1.00-2.el7.noarch
perl-IO-Socket-IP-0.21-4.el7.noarch
perl-IO-Compress-2.061-2.el7.noarch

nagios_send_service_mail.pl no graph if space is used in service name

Hi there,
thank you for this great notification script.
The only trouble I have is if the service description has a space in the name then the script fails to pick up the associated RRD file.
For example I have a service named Memory which I get notified when it is Warning/Critical with the attached graph however I have another one named Root Partition which notifies without graph.
I have tried to use the use URI::Escape pearl module but without success because my knowledge of Pearl is less than basic.
Any help or advice would be greatly appreciated.
Thank you

Notification --> exited with exit code 255

Hello,

based on Naemonbox installed on a debian 8.3 (https://github.com/mgadi/naemonbox)

I try to use pnp4n_send_service_mail.pl, but I have an error message (exited with exit code 255) in the logs of naemon:

image

To debug notifications, there is no problem:

debug_notification

If I execute this command : /usr/bin/printf "%b" "message de test Naemon" | /usr/bin/mail -s "test envoi de mail" [email protected] --> I get the good email

And if I run the other command : /usr/lib/naemon/plugins/pnp4nagios_send_service_mail.pl -v -t -r [email protected] -f graph -u -l en --> I have no problem, and I get out the test email.

image

It looks like he can not recover Naemon Global variables:

image

Can you help me ?

Help pnp4nagios send service

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.