Compare commits
2 Commits
c994264033
...
c88b397a0c
Author | SHA1 | Date |
---|---|---|
|
c88b397a0c | |
|
2ff689ae91 |
|
@ -252,6 +252,8 @@ RUN cd /opt/nagios/etc/objects && \
|
|||
RUN sed -i 's,/bin/mail,/usr/bin/mail,' ${NAGIOS_HOME}/etc/objects/000-commands.cfg && \
|
||||
sed -i 's,/usr/usr,/usr,' ${NAGIOS_HOME}/etc/objects/000-commands.cfg
|
||||
|
||||
RUN cp /opt/nagios/libexec/utils.pm /usr/lib/aarch64-linux-gnu/perl-base/
|
||||
|
||||
#VOLUME "${NAGIOS_HOME}/var" "${NAGIOS_HOME}/etc" "/var/log/apache2" "/opt/Custom-Nagios-Plugins" "/opt/nagiosgraph/var" "/opt/nagiosgraph/etc"
|
||||
|
||||
CMD [ "/usr/local/bin/start_nagios" ]
|
||||
|
|
|
@ -12,7 +12,7 @@ services:
|
|||
build:
|
||||
dockerfile: Dockerfile
|
||||
container_name: nagios
|
||||
image: docker-registry1.in.thelinuxpro.net:5000/tlp/nagios:241230.0.6
|
||||
image: docker-registry1.in.thelinuxpro.net:5000/tlp/nagios:241230.0.7
|
||||
networks:
|
||||
infra_dev_net:
|
||||
ipv4_address: 10.99.23.36
|
||||
|
|
|
@ -130,7 +130,6 @@ close(OPENSSL);
|
|||
$date =~ s/ +/ /g;
|
||||
|
||||
my ($month, $day, $hour, $min, $sec, $year, $tz) = split(/[\s+|:]/, $date);
|
||||
print "m=$month, d=$day, h=$hour, m=$min, s=$sec, y=$year, z=$tz\n";
|
||||
|
||||
my $daysLeft = int((timegm($sec, $min, $hour, $day, $months{$month}, $year - 1900) - time()) / 86400);
|
||||
|
||||
|
@ -153,17 +152,19 @@ if ($verbose) {
|
|||
}
|
||||
|
||||
if ($daysLeft < 0) {
|
||||
print "$PROGNAME: CRITICAL - $cn expired " . abs($daysLeft) . " day(s) ago.\n";
|
||||
print "$PROGNAME: CRITICAL - $cn expired " . abs($daysLeft) . " day(s) ago. m=$month, d=$day, h=$hour, m=$min, s=$sec, y=$year, z=$tz\n";
|
||||
} elsif ($daysLeft <= $critical) {
|
||||
print "$PROGNAME: CRITICAL - only $daysLeft day(s) left for $cn.\n";
|
||||
print "$PROGNAME: CRITICAL - only $daysLeft day(s) left for $cn. m=$month, d=$day, h=$hour, m=$min, s=$sec, y=$year, z=$tz\n";
|
||||
exit $ERRORS{'CRITICAL'};
|
||||
} elsif ($daysLeft <= $warning) {
|
||||
print "$PROGNAME: WARNING - only $daysLeft day(s) left for $cn.\n";
|
||||
print "$PROGNAME: WARNING - only $daysLeft day(s) left for $cn. m=$month, d=$day, h=$hour, m=$min, s=$sec, y=$year, z=$tz\n";
|
||||
exit $ERRORS{'WARNING'};
|
||||
} elsif ($verbose) {
|
||||
print "$PROGNAME: $daysLeft day(s) left for $cn.\n";
|
||||
print "$PROGNAME: $daysLeft day(s) left for $cn. m=$month, d=$day, h=$hour, m=$min, s=$sec, y=$year, z=$tz\n";
|
||||
}
|
||||
|
||||
print "m=$month, d=$day, h=$hour, m=$min, s=$sec, y=$year, z=$tz\n";
|
||||
|
||||
exit $ERRORS{'OK'};
|
||||
|
||||
sub print_help {
|
||||
|
|
Loading…
Reference in New Issue