akadoya / nagios-msteams Goto Github PK
View Code? Open in Web Editor NEWNagios notification for MS teams
Nagios notification for MS teams
Is there anyway you can provide command and contact examples?
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.
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.
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>"
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
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.