Command
Code: Select all
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:
Code: Select all
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
Code: Select all
Response:
HTTP/1.1 200 OK
Perl modules:
Code: Select all
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
Code: Select all
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.
Code: Select all
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$@";
}