Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
0
votes
0
answers
31
views
Performance Graph in icinga for a service shows wait timed out after 3001ms
The performance graph for a sakuli check shows 'Wait timed out after 3001ms'. I checked the check_latency for the sakuli check service it is at 0.446 seconds. The check is executed after every 2 minutes. What can be the cause. Performance data looks good but still the error persist. [Performance gra...
The performance graph for a sakuli check shows 'Wait timed out after 3001ms'. I checked the check_latency for the sakuli check service it is at 0.446 seconds. The check is executed after every 2 minutes. What can be the cause.
Performance data looks good but still the error persist.






sakuliuser123
(1 rep)
May 15, 2025, 07:32 AM
• Last activity: May 21, 2025, 07:34 AM
2
votes
0
answers
3241
views
Thruk installation "failed to open socket"
I am extremely confused, and Google isn't really helping. Also, I'm kind of a Linux novice. I've taken a couple of classes, but that was all about how to configure things in a basic Linux setup. I'm now trying to learn how to set things up to actually use. At work we use Nagios/Thruk so I'm trying t...
I am extremely confused, and Google isn't really helping. Also, I'm kind of a Linux novice. I've taken a couple of classes, but that was all about how to configure things in a basic Linux setup. I'm now trying to learn how to set things up to actually use. At work we use Nagios/Thruk so I'm trying to set it up on my home network so I can learn it better.
I set up a CentOS 6.6 machine. I've installed Nagios on it, and that's working fine. Now I'm trying to set up Thruk. I've managed to get livestatus and Thruk installed, but I'm stuck at getting it to actually work. In the documentation it shows that I'm supposed to add these two lines to the
/usr/local/nagios/etc/nagios.cfg
file:
broker_module=/usr/local/lib/mk-livestatus/livestatus.o /var/lib/nagios/rw/live
event_broker_options=-1
the event_broker_options=-1 line already existed, so I added the other line above it. In some examples, it is shown as this instead:
broker_module=/usr/local/lib/mk-livestatus/livestatus.o /tmp/live.sock
event_broker_options=-1
I've tried both, and I cannot seem to get this to work. I've done all the basics I can think of. I've reinstalled and updated all of the components (nagios, livestatus, thruk), I've reloaded and restarted all service associated a billion times. When the line I added is in there, Nagios starts when I tell it to start, but it then stops immediately. When I go into the /usr/local/nagios/var/nagios.log
file, I see the following lines whenever I try to start Nagios and it fails:
Error: Could not load module '/usr/local/lib/mk-livestatus/livestatus.o' -> /usr/local/lib/mk-livestatus/livestatus.o: undefined symbol: last_command_check
Error: Failde to load module '/usr/local/lib/mk-livestatus/livestatus.o' .
Error: Module loading failed. Aborting.
If I comment out the line I added to the nagios.cfg
file, Nagios will load and work properly, but Thruk still isn't working properly. If I load the Thruk page, I get this:
No Backend available
None of the configured Backends could be reached, please have a look at the logfile for detailed information and make sure the core is up and running.
Details:
home-net: ERROR: failed to open socket /tmp/live.sock: No such file or directory (/tmp/live.sock)
It appears to me to be something wrong with livestatus, but I don't understand it well enough to fix it on my own and I'm having a lot of difficulty finding (or maybe understanding) the answer anywhere. From what I understood, I thought the nagios.cfg
file was supposed to configure the live.sock file. Is that not correct? I'm doing my best, but I need some help.
duzzy
(141 rep)
Dec 19, 2014, 01:22 AM
• Last activity: Feb 4, 2025, 09:05 PM
0
votes
0
answers
64
views
Nagios check_http returning Cannot make SSL connection error on CentOS 7
I'm running a site on Apache (httpd) on a CentOS 7 host and monitoring it using Nagios on another CentOS 7 host. The configuration in Nagios is: define service { check_command check_http_url!/my_class/product/session!-f follow -S host_name mysite.com use critical-service service_description My Site...
I'm running a site on Apache (httpd) on a CentOS 7 host and monitoring it using Nagios on another CentOS 7 host. The configuration in Nagios is:
define service {
check_command check_http_url!/my_class/product/session!-f follow -S
host_name mysite.com
use critical-service
service_description My Site Production
servicegroups production-sites
}
This has been working until recently. Nagios is now reporting the following error:
CRITICAL - Cannot make SSL connection.
I have run the following and also see the error:
[root@mynagiosserver-01 ~]# /usr/lib64/nagios/plugins/check_http -H mysite.com -u /my_class/product/session -f follow -S -v
CRITICAL - Cannot make SSL connection.
SSL initialized
On the Nagios host, mysite.com maps to the Apache host IP address in the
/etc/hosts
file.
Any ideas on how I can troubleshoot this further?
Confounder
(131 rep)
Dec 11, 2024, 06:53 PM
0
votes
1
answers
23
views
Include action_url in Nagios notification by email?
Is there a possible way to include `action_url` ( of the service definition ) in the email template ?
Is there a possible way to include
action_url
( of the service definition ) in the email template ?
Ricky Levi
(113 rep)
Nov 3, 2024, 12:04 PM
• Last activity: Nov 21, 2024, 01:31 AM
0
votes
1
answers
159
views
Nagios compilation problem in hardened OS
I am trying to install nagios in hardened OS CentOS, but I can not: checking for a BSD-compatible install... /usr/bin/install -c checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking for gcc... gcc checking whether the C compiler works... yes che...
I am trying to install nagios in hardened OS CentOS, but I can not:
checking for a BSD-compatible install... /usr/bin/install -c
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/home/nagios-4.3.2':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
I already installed all gcc packages, but can not
any advice ?
0xGJx0
(1 rep)
Oct 16, 2017, 02:29 PM
• Last activity: Feb 8, 2024, 10:12 AM
1
votes
1
answers
2807
views
Nagios variable $HOSTNAME$ in service definition
I got the following error: Error: Could not find any host matching '$HOSTNAME$' (config file '/usr/local/nagios/etc/servers/example.com.cfg', starting on line 136) Error: Failed to expand host list '$HOSTNAME$' for service 'HTTP' (/usr/local/nagios/etc/servers/example.com.cfg:136) My host/service de...
I got the following error:
Error: Could not find any host matching '$HOSTNAME$' (config file '/usr/local/nagios/etc/servers/example.com.cfg', starting on line 136)
Error: Failed to expand host list '$HOSTNAME$' for service 'HTTP' (/usr/local/nagios/etc/servers/example.com.cfg:136)
My host/service definition:
define host{
use linux-server ; Name of host template to use
; This host definition will inherit all variables that are defined
; in (or inherited by) the linux-server host template definition.
host_name example.com
alias example.com
address 127.0.0.1
}
###############################################################################
###############################################################################
#
# HOST GROUP DEFINITION
#
###############################################################################
###############################################################################
# Define an optional hostgroup for Linux machines
define hostgroup{
hostgroup_name linux-servers ; The name of the hostgroup
alias Linux Servers ; Long name of the group
members example.com ; Comma separated list of hosts that belong to this group
}
My template:
# Local service definition template - This is NOT a real service, just a template!
define service{
name local-service ; The name of this service template
use generic-service ; Inherit default values from the generic-service definition
max_check_attempts 4 ; Re-check the service up to 4 times in order to determine its final (hard) state
check_interval 5 ; Check the service every 5 minutes under normal conditions
retry_interval 1 ; Re-check the service every minute until a hard state can be determined
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
}
define service{
name http
check_command check_http
notifications_enabled 0
service_description HTTP
host_name $HOSTNAME$
register 0
}
define service{
use local-service,http ; Name of service template to use
# host_name example.com
}
It's a fairly default Nagios, didn't do anything special with it. Am I using $HOSTNAME$ wrong or something?
Would be nice if I can get a variable for the hostname, much less copy pasting etc :)
Thank you!
Florius
(111 rep)
Apr 26, 2018, 08:07 PM
• Last activity: Sep 30, 2023, 05:02 PM
1
votes
1
answers
98
views
Nagios/SNMP - devices alerting when ppp/tun connections cycle
Sorry if this is a repeat. I searched, but with no luck. I'm using SNMPd on an openwrt/wr host with some ppp and tun connections. These connections get IDs in the if table, and will actually get a new ID whenever the tunnels reconnect. Nagios (check_mk), when that happens, complains that an interfac...
Sorry if this is a repeat. I searched, but with no luck.
I'm using SNMPd on an openwrt/wr host with some ppp and tun connections. These connections get IDs in the if table, and will actually get a new ID whenever the tunnels reconnect.
Nagios (check_mk), when that happens, complains that an interface went down; oh, and a different one with the same name came up right afterward. In the meantime, it's iterating over so many interfaces that the reports are of 'interface 4933 down'; and an snmpwalk shows close to 4932 datapoints before it.
How are the helpful folks here handling a monitoring situation like that?
user2066657
(629 rep)
Dec 14, 2016, 05:57 PM
• Last activity: Sep 13, 2023, 02:40 PM
0
votes
2
answers
510
views
nagios: why this error?
My kdc plugin works fine /usr/lib64/nagios/plugins/check_kdc -H samba4 -p nagios/nagios1.mydom.priv@MYDOM.PRIV -k /etc/nagios/nagios.keytab OK But give me this error on webpage (Return code of 13 for service 'KDC' on host 'samba4' was out of bounds) this is the cfg commands.cfg define command{ comma...
My kdc plugin works fine
/usr/lib64/nagios/plugins/check_kdc -H samba4 -p nagios/nagios1.mydom.priv@MYDOM.PRIV -k /etc/nagios/nagios.keytab
OK
But give me this error on webpage
(Return code of 13 for service 'KDC' on host 'samba4' was out of bounds)
this is the cfg
commands.cfg
define command{
command_name check_kdc
command_line /usr/lib64/nagios/plugins/check_kdc -H $HOSTADDRESS$ -k $ARG1$ -p $ARG2$
}
mydom.cfg
define service{
use local-service ; Name of service template to use
host_name samba4
service_description KDC
check_command check_kdc!/etc/nagios/nagios.keytab!nagios/nagios1.mydom.priv@MYDOM.PRIV
notifications_enabled 1
}
Why nagios return error 13?
elbarna
(13690 rep)
Jan 3, 2023, 03:11 AM
• Last activity: Apr 4, 2023, 06:24 PM
0
votes
0
answers
41
views
how to monitor servers properly with nagios?
Currently, I'm using nrpe to monitor clients using Nagios but when nrpe goes down then all the stat goes to an unknown state which causes it difficult to monitor critical alerts... What and how should I prove so that I never miss critical alerts?
Currently, I'm using nrpe to monitor clients using Nagios but when nrpe goes down then all the stat goes to an unknown state which causes it difficult to monitor critical alerts...
What and how should I prove so that I never miss critical alerts?
user561715
(1 rep)
Feb 22, 2023, 06:19 AM
1
votes
1
answers
1154
views
How to validate NRPE config file?
Nagios itself has the way to check its config file for validity, to ensure it would at least load the config without errors: ``` /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg ``` Is it possible to do the same thing for the NRPE daemon? The manual page for NRPE suggests it doesn't...
Nagios itself has the way to check its config file for validity, to ensure it would at least load the config without errors:
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Is it possible to do the same thing for the NRPE daemon? The manual page for NRPE suggests it doesn't support that.
I intend to update the NRPE config with Ansible's lineinfile module, so I want to check for validity to be sure at least I don't break the monitoring completely.
Nikita Kipriyanov
(1779 rep)
Sep 26, 2022, 05:56 AM
• Last activity: Sep 26, 2022, 04:22 PM
2
votes
2
answers
9607
views
Executing a script from Nagios event handler fails to run
I have Nagios running on a webserver. For this one Nagios service check in particular, if it fails, it will run a script. This script is triggered via Nagios event handlers. Nagios event handler command: define command{ command_name testDisableServer command_line /usr/local/nagios/etc/objects/event_...
I have Nagios running on a webserver. For this one Nagios service check in particular, if it fails, it will run a script. This script is triggered via Nagios event handlers.
Nagios event handler command:
define command{
command_name testDisableServer
command_line /usr/local/nagios/etc/objects/event_handlers/testDisableServer.sh
}
I am executing a script called testDisableServer.sh from Nagios event handlers that looks like this:
#!/bin/bash
wall "Script execution started";
/usr/bin/sudo /root/scripts/disableServer.sh force
This script 'testDisableServer.sh' has the following permissions:
-rwxr-xr-x 1 nagios nagios 2.0K Oct 12 14:57 testDisableServer.sh
When the service goes down, I will get a wall post in my SSH connection saying "Script execution started", but it will not trigger my disableServer.sh script. I tried to place another wall post inside of disableServer.sh and it did not trigger it.
This script is being run by the user 'nagios'. 'nagios' was added in visudo, as such:
nagios ALL=(ALL)NOPASSWD:/root/scripts/disableServer.sh
Running this script as the user 'nagios' from a command line works perfectly fine. However, when the event handler triggers it, there is no output. I tried to catch the output into a log file, and I came up with nothing. These are the permissions on /root/scripts/disableServer.sh:
-rwxr-xr-x 1 root root 2.0K Oct 12 15:01 disableServer.sh
Why would the event handler hit 'testDisableServer.sh', but not execute 'disableServer.sh' from a Nagios event handler, but work just fine in an SSH connection as the user nagios? BTW, 'testDisableServer.sh' is just an extra layer added to see if the event handlers were working, which they seem to be. This will be removed after this script execution is all sorted out.
Ryan
(23 rep)
Oct 12, 2012, 05:38 PM
• Last activity: Sep 7, 2022, 03:13 PM
1
votes
0
answers
339
views
Tell nagios not to warn about non-critical updates
I use nagios to warn if there are apt updates available on my Debian buster server, but I want to use this option: -o, --only-critical Only warn about upgrades matching the critical list. The total number of upgrades will be printed, but any non-critical upgrades will not cause the plugin to return...
I use nagios to warn if there are apt updates available on my Debian buster server, but I want to use this option:
-o, --only-critical
Only warn about upgrades matching the critical list. The total number
of upgrades will be printed, but any non-critical upgrades will not cause
the plugin to return WARNING status.
so I edited
/etc/nagios-plugins/config/apt.cfg
:
# 'check_apt' command definition
define command{
command_name check_apt
command_line /usr/lib/nagios/plugins/check_apt --only-critical
}
# 'check_apt_distupgrade' command definition
define command{
command_name check_apt_distupgrade
command_line /usr/lib/nagios/plugins/check_apt --only-critical -d
}
But still I get emails containing something like:
***** Service Monitoring on freifunk *****
apt on vm02.freifunk is WARNING!
Info: APT WARNING: 2 packages available for upgrade (0 critical updates).
Although I have installed monitoring-plugins-basic
2.2-6 and
the --only-critical
option was added in release-2.3.3
it is working already:
# /usr/lib/nagios/plugins/check_apt
APT WARNING: 2 packages available for upgrade (0 critical updates). |available_upgrades=2;;;0 critical_updates=0;;;0
# /usr/lib/nagios/plugins/check_apt --only-critical
APT OK: 2 packages available for upgrade (0 critical updates). |available_upgrades=2;;;0 critical_updates=0;;;0
But the command option I set in the nagios config seems to be ignored.
I also tried the latest version manually installed from this source , but it didn't change the outcome. Maybe is there another way to achieve this? maybe just change the line in command_line to something, that greps the result somehow?
it seems like the nagios plugins are used by icinga2
. This is a part of /etc/icinga2/constants.conf
:
/* The directory which contains the plugins from the Monitoring Plugins project. */
const PluginDir = "/usr/lib/nagios/plugins"
How do I properly tell nagios not to warn about non-critical updates?
rubo77
(30435 rep)
Jul 20, 2020, 06:00 AM
• Last activity: Jul 7, 2022, 09:25 AM
9
votes
2
answers
28932
views
chcon: can't apply partial context to unlabeled file while installing nagios with SELinux
I'm setting up Nagios core on CentOS with SELINUX=enforcing. I try to run chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin/ as [suggested in the manual](http://nagios.sourceforge.net/docs/nagioscore/3/en/quickstart-fedora.html), but I get this error messages: chcon: can't apply partial context...
I'm setting up Nagios core on CentOS with SELINUX=enforcing.
I try to run
chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin/
as [suggested in the manual](http://nagios.sourceforge.net/docs/nagioscore/3/en/quickstart-fedora.html) , but I get this error messages:
chcon: can't apply partial context to unlabeled file `cmd.cgi'
chcon: can't apply partial context to unlabeled file `trends.cgi'
chcon: can't apply partial context to unlabeled file `histogram.cgi'
chcon: can't apply partial context to unlabeled file `avail.cgi'
chcon: can't apply partial context to unlabeled file `history.cgi'
chcon: can't apply partial context to unlabeled file `status.cgi'
chcon: can't apply partial context to unlabeled file `tac.cgi'
chcon: can't apply partial context to unlabeled file `showlog.cgi'
chcon: can't apply partial context to unlabeled file `notifications.cgi'
chcon: can't apply partial context to unlabeled file `extinfo.cgi'
chcon: can't apply partial context to unlabeled file `statuswml.cgi'
chcon: can't apply partial context to unlabeled file `outages.cgi'
chcon: can't apply partial context to unlabeled file `statuswrl.cgi'
chcon: can't apply partial context to unlabeled file `statusmap.cgi'
chcon: can't apply partial context to unlabeled file `config.cgi'
chcon: can't apply partial context to unlabeled file `summary.cgi'
Any ideas how to avoid these errors?
Mohammed Shannaq
(191 rep)
Oct 29, 2011, 07:17 PM
• Last activity: Jul 5, 2022, 06:01 AM
0
votes
0
answers
101
views
Nagios to automatically send Google Authentication verification code
At the moment, my workplace's Nagios server is configured to SSH into host machines and then execute bash scripts on those host machines. The customer now requires us to setup MFA for SSH sessions. I have successfully tested MFA using Google Authenticator by following this article: https://www.linod...
At the moment, my workplace's Nagios server is configured to SSH into host machines and then execute bash scripts on those host machines.
The customer now requires us to setup MFA for SSH sessions. I have successfully tested MFA using Google Authenticator by following this article: https://www.linode.com/docs/guides/how-to-use-one-time-passwords-for-two-factor-authentication-with-ssh-on-centos/ .
With MFA setup though, it will mean our Nagios server can no longer SSH into the host machines. I am wondering is there a way to configure the Nagios server to send verification codes automatically?
supmethods
(561 rep)
Jul 3, 2022, 09:10 AM
1
votes
0
answers
876
views
Nagios install issue: Failed to enable unit: Unit file nagios.service does not exist
I am trying to install Nagios on Alma 8. I am following the instructions on this website: https://www.tecmint.com/install-nagios-in-rocky-linux-and-almalinux/. In "Step 3 Install Nagios Core on Linux", I run the command ```sudo make install-daemoninit``` but I get the error message ```Failed to enab...
I am trying to install Nagios on Alma 8. I am following the instructions on this website: https://www.tecmint.com/install-nagios-in-rocky-linux-and-almalinux/ .
In "Step 3 Install Nagios Core on Linux", I run the command
make install-daemoninit
but I get the error message to enable unit: Unit file nagios.service does not exist.
.
What can I do to address this issue?
supmethods
(561 rep)
Jul 3, 2022, 07:42 AM
0
votes
1
answers
28
views
What are the differences/similarities between naghelp and nagiosplugin, and when would you use one and not the other?
I'm reading on `Nagios plugin` creation with Python, and I encountered [naghelp][1] and [nagiosplugin][2]. To my novice eyes, they look similar. When would one prefer to use `naghelp` over `nagiosplugin` (or vice versa)? [1]: https://readthedocs.org/projects/python-nagios-helpers/downloads/pdf/lates...
I'm reading on
Nagios plugin
creation with Python, and I encountered naghelp and nagiosplugin .
To my novice eyes, they look similar.
When would one prefer to use naghelp
over nagiosplugin
(or vice versa)?
boardrider
(262 rep)
Feb 26, 2022, 12:25 AM
• Last activity: Jun 2, 2022, 05:52 PM
0
votes
0
answers
100
views
nagios sending notifications to wrong contacts
I'm having a small issue that has been bugging me for some time now, and now it's time to fix it :) I have a Nagios Core 3.5 install running. In the Nagios configuration, we have a couple of service templates defined, all of these have a contact defined. We have some services that have to notify a d...
I'm having a small issue that has been bugging me for some time now, and now it's time to fix it :)
I have a Nagios Core 3.5 install running. In the Nagios configuration, we have a couple of service templates defined, all of these have a contact defined. We have some services that have to notify a different contact than the default contact defined at the service.
According to what I have read here I would expect the service definition to overwrite the default contact.
Example config:
define service{
name generic-service-5min
notifications_enabled 1
contacts contact1
notification_options w,u,c,r
notification_interval 60
notification_period businessday
register 0
}
define service{
use generic-service-5min
host_name HOST1
service_description CustomService
check_command CustomService
contacts Contact2
}
Maybe my understanding of this is incorrect and is this how it should work. But hopefully we can find a way that doesn't lead to messages to two different contacts but only one.
Thanks for any information and/or insights.
Meaglin
(1 rep)
Feb 8, 2022, 11:10 AM
3
votes
2
answers
553
views
Nagios Core 3.5 change Date format
How can the Date/Time format that Nagios uses everywhere be changed to YYYY-MM-DD HH:MM:SS? [![actual Nagios format][1]][1] [1]: https://i.sstatic.net/dJ32E.png
How can the Date/Time format that Nagios uses everywhere be changed to
YYYY-MM-DD HH:MM:SS?

amm
(45 rep)
Nov 29, 2021, 06:40 PM
• Last activity: Dec 1, 2021, 02:03 PM
0
votes
1
answers
152
views
Is it alright to add a disk size monitoring script for NAGIOS, using loop?
I have a process that gets sizes for all disks on server, writes it into a file like this # cat disksize DISK# ACTUAL WARNING CRITICAL disk1 12 20 30 disk2 45 60 75 first row of file is for reference, showing what each column is for. Below is monitoring script, but I'm not sure if it will work for n...
I have a process that gets sizes for all disks on server, writes it into a file like this
# cat disksize
DISK# ACTUAL WARNING CRITICAL
disk1 12 20 30
disk2 45 60 75
first row of file is for reference, showing what each column is for. Below is monitoring script, but I'm not sure if it will work for nagios, as some of these sizes may result in OK, some maybe in warning. Anyone give any insight on this, please
# cat check-disk_size
#!/usr/bin/env bash
LOGFILE='disksize'
cat ${LOGFILE} | while
read disk_name actual warning critical
do
if [ $actual -ge $warning ]; then
echo "WARNING: $disk_name has reached standard warning limit, Current actual: ${actual}"
exit 1
elif [ $actual - ge $critical ]; then
echo "WARNING: $disk_name has reached standard critical limit, Current actual: ${actual}"
exit 2
else
echo "OK: $disk_name is under optical limit, Current actual: ${actual}"
exit 0
done
Sollosa
(1993 rep)
Nov 24, 2021, 01:26 PM
• Last activity: Nov 24, 2021, 03:52 PM
0
votes
1
answers
689
views
Unable to read nagios exit status in nagios core
I am using a command to throw a specific exit status when error count in one of my log files exceed a certain limit. Command is as follows: `cd /home/serveradmin/logs/ | ls -trc | grep gateway | tail -1 | xargs cat | grep error | wc -l | awk '{if($1 >= "35000"){print "Critical: ",$1;exit 2} else if...
I am using a command to throw a specific exit status when error count in one of my log files exceed a certain limit. Command is as follows:
cd /home/serveradmin/logs/ | ls -trc | grep gateway | tail -1 | xargs cat | grep error | wc -l | awk '{if($1 >= "35000"){print "Critical: ",$1;exit 2} else if ($1 >= "25000") {print "Warning: ",$1;exit 1} else {exit 0} }'
After executing the command, I have verified the exit status (my command returns exit code 1, because error count in my file is greater than 25000) with the following command:
echo $?
The above command returns 1 as output.
In my nrpe.cfg file I have defined the same command as follows:
command[Error_Count]=cd /home/serveradmin/logs/ | ls -trc | grep gateway | tail -1 | xargs cat | grep error | wc -l | awk '{if($1 >= "35000"){exit 2} else if ($1 >= "25000") {exit 1} else {exit 0} }'
I have defined the service in nagios core as follows:
define service {
host_name test_vm
service_description Error_Count
check_command check_nrpe!Error_Count
use generic-service
check_interval 1
}
After defining the service, nagios core is unable to read the exit status from the defined command in the nrpe.cfg file at client's end.
The error in my nagios dashboard returns an unknown status:
Faisal Nawaz
(1 rep)
Nov 16, 2021, 06:57 AM
• Last activity: Nov 16, 2021, 02:44 PM
Showing page 1 of 20 total questions