Code Monkey home page Code Monkey logo

nagios-msteams's People

Contributors

akadoya avatar aoi-kadoya avatar chillfox avatar christian-mornard avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nagios-msteams's Issues

Use of uninitialized value $nagios

Hi.

Getting this when I run the command, anything I'm missing?

Use of uninitialized value $nagios{"SERVICESTATE"} in string at ./nagios-msteams.pl line 64.
Use of uninitialized value $nagios{"HOSTALIAS"} in concatenation (.) or string at ./nagios-msteams.pl line 65.
Use of uninitialized value $nagios{"SERVICESTATE"} in concatenation (.) or string at ./nagios-msteams.pl line 65.
Use of uninitialized value $nagios{"HOSTALIAS"} in string at ./nagios-msteams.pl line 67.
Use of uninitialized value $nagios{"SERVICEOUTPUT"} in string at ./nagios-msteams.pl line 67.
Use of uninitialized value in concatenation (.) or string at ./nagios-msteams.pl line 79.

Empty notification when used on Centreon

Hello,

We've just discover this plugin, and we're tryinh to do it work on Centreon.

The notification is sent, but no information on it:

Captura de pantalla 2024-01-11 164603

It wold be great if the variables sent on the notification could be specified as option field when executing the script.

move to new server: "network is unreachable"

We are migrating to a new server (CentOS 7 > RHEL 8), and I'm trying to get this plugin working on the new instance. The configuration is the same - restored from backup. Both are on the same network, behind the same proxy. The CentOS 7 server can send notifications just fine, but copying the command & running on the RHEL 8 instance produces an error. I'm thinking it's something to do with the Perl env, but I'm not sure. CentOS 7 instance is running 5.8.4; RHEL instance is running 5.9.3.

Command

export https_proxy=http://proxy01.<domain>:3128 NAGIOS_HOSTALIAS="TESTHOST01" NAGIOS_SERVICEDESC="http" NAGIOS_SERVICESTATE="WARNING" NAGIOS_SERVICEOUTPUT="test output" && /usr/local/nagios/libexec/nagios-msteams.pl --webhook "https://<webhookURL>" --nagios_url "https://nagios.<domain>"

CentOS 7 instance (working)

Perl modules:

Installed modules are:
   App::cpanminus
   Archive::Zip
   B::COW
   CPAN::Meta
   CPAN::Meta::Requirements
   CPAN::Meta::YAML
   Capture::Tiny
   Clone
   Compress::Raw::Zlib
   Crypt::OpenSSL::RSA
   Devel::CheckLib
   Encode
   ExtUtils::CBuilder
   ExtUtils::Config
   ExtUtils::Helpers
   ExtUtils::InstallPaths
   File::Listing
   HTTP::Cookies
   HTTP::Daemon
   HTTP::Date
   HTTP::Message
   HTTP::Negotiate
   IO::Socket::IP
   IPC::Cmd
   JSON
   JSON::PP
   LWP
   LWP::MediaTypes
   LWP::Protocol::https
   Locale::Maketext::Simple
   Mock::Config
   Module::Build
   Module::Build::Tiny
   Module::CoreList
   Module::Load
   Module::Load::Conditional
   Module::Metadata
   Net::HTTP
   Net::INET6Glue
   Params::Check
   Path::Class
   Perl
   Perl::OSType
   Test::Fatal
   Test::Harness
   Test::More::UTF8
   Test::Needs
   Test::RequiresInternet
   Test::Warnings
   Text::Template
   Time::Local
   Time::Piece
   Try::Tiny
   UUID
   WWW::RobotRules
   libwww::perl
   version

Command output:

Response:
HTTP/1.1 200 OK

RHEL 8 instance (not working):

Perl modules:

Installed modules are:
   App::cpanminus
   B::COW
   B::Hooks::EndOfScope
   Bytes::Random::Secure
   CPAN::Meta::Check
   Canary::Stability
   Capture::Tiny
   Class::Accessor
   Class::Data::Inheritable
   Class::Inspector
   Class::Singleton
   Class::Tiny
   Clone
   Config::Tiny
   Crypt::Random::Seed
   Crypt::Random::TESHA2
   Crypt::SSLeay
   DateTime
   DateTime::Locale
   DateTime::TimeZone
   Devel::CheckLib
   Devel::StackTrace
   Dist::CheckConflicts
   Encode
   Eval::Closure
   Exception::Class
   File::Copy::Recursive
   File::ShareDir
   File::ShareDir::Install
   File::Slurper
   HTTP::Message
   IO::Compress::Brotli
   IO::Socket::INET6
   IPC::Run3
   Importer
   JSON
   JSON::XS
   LWP::Protocol::https
   Math::Calc::Units
   Math::Random::ISAAC
   Mock::Config
   Module::Build
   Module::Implementation
   Module::Pluggable
   Module::Runtime
   Mozilla::CA
   Nagios::Monitoring::Plugin
   Net::INET6Glue
   Package::Stash
   Package::Stash::XS
   Params::Validate
   Params::ValidationCompiler
   Path::Class
   Path::Tiny
   Perl
   PerlIO::utf8_strict
   Role::Tiny
   Scope::Guard
   Socket6
   Specio
   Spiffy
   Sub::Exporter::Progressive
   Sub::Identify
   Sub::Info
   Sub::Quote
   Sub::Uplevel
   Term::Table
   Test2::Plugin::NoWarnings
   Test2::Suite
   Test::Base
   Test::Deep
   Test::Exception
   Test::Fatal
   Test::File
   Test::File::ShareDir
   Test::Needs
   Test::NoWarnings
   Test::Requires
   Test::RequiresInternet
   Test::Simple
   Test::Warnings
   Test::Without::Module
   Test::YAML
   Time::Piece
   Types::Serialiser
   UUID
   Variable::Magic
   XString
   YAML
   common::sense
   namespace::autoclean
   namespace::clean

Command output:

Response:
500 Can't connect to *.webhook.office.com:443 (Network is unreachable)
Content-Type: text/plain
Client-Date: Fri, 05 May 2023 13:09:01 GMT
Client-Warning: Internal response

Can't connect to *.webhook.office.com:443 (Network is unreachable)

Network is unreachable at /usr/share/perl5/vendor_perl/LWP/Protocol/http.pm line 50.

It looks like the code block that's giving this error is:

    unless ($sock) {
        # IO::Socket::INET leaves additional error messages in $@
        my $status = "Can't connect to $host:$port";
        if ($@ =~ /\bconnect: (.*)/ ||
            $@ =~ /\b(Bad hostname)\b/ ||
            $@ =~ /\b(nodename nor servname provided, or not known)\b/ ||
            $@ =~ /\b(certificate verify failed)\b/ ||
            $@ =~ /\b(Crypt-SSLeay can't verify hostnames)\b/
        ) {     
            $status .= " ($1)";
        } elsif ($@) {
            $status .= " ($@)";
        }       
        die "$status\n\n$@";
    }

I'm hoping you can help me figure out what's causing this issue.

Setting ENV variable

Hello,

When i receive the notification on teams, the content is empty with the default value set in the code.

image

Where are those environment variables set ? Why would they not be set by my nagios ?

Is there any reason you choose to pass by env variable and not parameters for the script?

Thanks.

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.