net-mgmt/nagios-check_relayd_status: minor style fixes in the script

Git rid of UTF-8 apostrophe and contraction altogether (it is spelled
as "cannot" elsewhere throughout the code) and whack EOL whitespace.
This commit is contained in:
Alexey Dokuchaev 2023-05-10 09:59:32 +00:00
parent 39e0e692d6
commit 9d49b37d57

View File

@ -64,7 +64,7 @@ if not all hosts in a table are up and a critical if a table
and/or redirect is totally down. and/or redirect is totally down.
Options: Options:
--help --help
Print detailed this screen Print detailed this screen
--redirect STRING --redirect STRING
String with name of redirect to check. Multiple redirects String with name of redirect to check. Multiple redirects
@ -74,13 +74,13 @@ Options:
can be seperated by comma can be seperated by comma
Examples: Examples:
$0 $0
Checks if all redirects, tables and hosts which are Checks if all redirects, tables and hosts which are
defined at the relayd startup are active. defined at the relayd startup are active.
$0 --redirect smtp --table pmtahost,pmtahostfallback $0 --redirect smtp --table pmtahost,pmtahostfallback
Checks if the specified redirects and tables exists. Checks if the specified redirects and tables exists.
Besides there will be an alert if any other redirect Besides there will be an alert if any other redirect
or table defined in the checked relayd is not active. or table defined in the checked relayd is not active.
@ -126,10 +126,10 @@ my @execute = ($command, $parameter);
# make unbuffered output # make unbuffered output
$|=1; $|=1;
open STDERR, ">&STDOUT" or die "Cant dup STDOUT: $!"; open STDERR, ">&STDOUT" or die "Cannot dup STDOUT: $!";
eval { eval {
my @return = split(/\n/, `@execute`) my @return = split(/\n/, `@execute`)
or die "command returns an errorcode $?: '@execute'"; or die "command returns an errorcode $?: '@execute'";
foreach ( @return ) { foreach ( @return ) {
@ -149,7 +149,7 @@ eval {
if ( $cnt_hosts{'up'} == 0 ) { if ( $cnt_hosts{'up'} == 0 ) {
print "CRITICAL: relayd does not find any hosts up\n"; print "CRITICAL: relayd does not find any hosts up\n";
exit(2); exit(2);
} }
for my $red ( keys %cnt_redirects ) { for my $red ( keys %cnt_redirects ) {
if ( $cnt_redirects{$red} == 0 ) { if ( $cnt_redirects{$red} == 0 ) {