check_file_age error
-
[email protected]
- Posts: 66
- Joined: Tue Aug 07, 2018 2:24 am
check_file_age error
hi Team,
i am facing below error.
/usr/local/nagios/libexec/check_nrpe -H nagios-client ip -c check_file_age -a "-w 180 -c 300 -f /dir/dir/dir/logs/log.log"
FILE_AGE CRITICAL: File not found - /dir/dir/dir/logs/log.log
|
i am facing below error.
/usr/local/nagios/libexec/check_nrpe -H nagios-client ip -c check_file_age -a "-w 180 -c 300 -f /dir/dir/dir/logs/log.log"
FILE_AGE CRITICAL: File not found - /dir/dir/dir/logs/log.log
|
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check_file_age error
Looks like the nagios user cannot see the file
On the server nagios-client ip
Can you show the output of the following
On the server nagios-client ip
Can you show the output of the following
Code: Select all
su nagios
ls -l /dir/dir/dir/logs/log.log-
[email protected]
- Posts: 66
- Joined: Tue Aug 07, 2018 2:24 am
Re: check_file_age error
hi Team,
for nagios user there is no login shell, i am unable to switch to nagios user.
Please find the output below.
-rw-rw---- 1 appuser appuser 678K Sep 10 17:47 /dir/sir/dir/logs/access.log
for nagios user there is no login shell, i am unable to switch to nagios user.
Please find the output below.
-rw-rw---- 1 appuser appuser 678K Sep 10 17:47 /dir/sir/dir/logs/access.log
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check_file_age error
Ok this means that the nagios user doesn't have access to see the file[email protected] wrote:hi Team,
for nagios user there is no login shell, i am unable to switch to nagios user.
Please find the output below.
-rw-rw---- 1 appuser appuser 678K Sep 10 17:47 /dir/sir/dir/logs/access.log
Code: Select all
-rw-rw---- 1 appuser appuser -
[email protected]
- Posts: 66
- Joined: Tue Aug 07, 2018 2:24 am
Re: check_file_age error
Hi team,
i have added nagios user to service account group.
i am facing below error wen i am checking from nagios server.
Log file permission :- -rwxrwx--- 1 appuser appuser 157K Sep 15 17:54 /dir/dir/dir/logs/
access.log
Output from Nagios Client.
sudo -H -u nagios /usr/lib/nagios/plugins/check_file_age /dir/dir/dir/logs/access.log
FILE_AGE OK: /dir/dir/dir/logs/access.log is 3 seconds old and 125304 bytes | age=3s;240;600 size=125304B;0;0;0
and
su - nagios -s /usr/lib/nagios/plugins/check_file_age /dir/dir/dir/logs/access.log
Output from Nagios Server
/usr/local/nagios/libexec/check_nrpe -H 192.168.105.93 -c check_file_age -a "-w 180 -c 300 -f /dir/dir/dir/logs/access.log"
FILE_AGE CRITICAL: File not found - /dir/dir/dir/logs/access.log
|
when i changed permission to 777 for it is working, but as per security reasons we can not change to 777 permission
i have added nagios user to service account group.
i am facing below error wen i am checking from nagios server.
Log file permission :- -rwxrwx--- 1 appuser appuser 157K Sep 15 17:54 /dir/dir/dir/logs/
access.log
Output from Nagios Client.
sudo -H -u nagios /usr/lib/nagios/plugins/check_file_age /dir/dir/dir/logs/access.log
FILE_AGE OK: /dir/dir/dir/logs/access.log is 3 seconds old and 125304 bytes | age=3s;240;600 size=125304B;0;0;0
and
su - nagios -s /usr/lib/nagios/plugins/check_file_age /dir/dir/dir/logs/access.log
Output from Nagios Server
/usr/local/nagios/libexec/check_nrpe -H 192.168.105.93 -c check_file_age -a "-w 180 -c 300 -f /dir/dir/dir/logs/access.log"
FILE_AGE CRITICAL: File not found - /dir/dir/dir/logs/access.log
|
when i changed permission to 777 for it is working, but as per security reasons we can not change to 777 permission
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check_file_age error
We are going to make sure the nagios user has access to look in the directories
Can you show the results of the following
Also, can we verify that nrpe is running as the nagios user
Can you show the results of the following
Code: Select all
ls -ld /dir/dir/dir/logs
ls -ld /dir/dir/dir
ls -ld /dir/dir
ls -ld /dirCode: Select all
ps -ef|grep nrpe-
[email protected]
- Posts: 66
- Joined: Tue Aug 07, 2018 2:24 am
Re: check_file_age error
Please find the directory details.
drwxrwx--- 2 appuser appuser /dir/dir/dir/logs
drwxrwx--- 5 appuser appuser /dir/dir/dir
drwxrwxrwx 25 appuser appuser /dir/dir
drwxrwxrwx 12 appuser appuser /dir
NRPE is running in xinetd.
netstat -anltp |grep 5666
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN 21221/xinetd
drwxrwx--- 2 appuser appuser /dir/dir/dir/logs
drwxrwx--- 5 appuser appuser /dir/dir/dir
drwxrwxrwx 25 appuser appuser /dir/dir
drwxrwxrwx 12 appuser appuser /dir
NRPE is running in xinetd.
netstat -anltp |grep 5666
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN 21221/xinetd
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check_file_age error
then we will need to see the user from xinetd config[email protected] wrote:NRPE is running in xinetd.
netstat -anltp |grep 5666
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN 21221/xinetd
Code: Select all
grep user /etc/xinetd.d/nrpe-
[email protected]
- Posts: 66
- Joined: Tue Aug 07, 2018 2:24 am
Re: check_file_age error
grep user /etc/xinetd.d/nrpe
user = nagios
user = nagios
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check_file_age error
Ok, one more check[email protected] wrote:grep user /etc/xinetd.d/nrpe
user = nagios
Code: Select all
grep nagios /etc/group