Nagios Core - LogFile Monitoring in Unix server
Nagios Core - LogFile Monitoring in Unix server
Hi All,
We are using Nagios Core 4.0.8 and we got a request to monitor for "Error" word in the log file on Unix server.
We tried configuring this service using check_log plugin .
=============================================
Check command in Service definition on host.cfg is as below:
check_command check_log_dc1uat163_oldone!-F /apps/wildfly-11.0.0/standalone/log/server.log.2019-06-20 -O /apps/wildfly-11.0.0/standalone/log/server.log -q "ERROR"
=======================================================
commands.cfg is below:
define command{
command_name check_log_dc1uat163_oldone
command_line $USER2$/check_log $ARG1$ $ARG2$ $ARG3$
}
=========================
However it is giving error as below:
Log check error: Log file /apps/wildfly-11.0.0/standalone/log/server.log.2019-06-20 does not exist!
Can someone pls suggest how to configure for this kind of monitoring.
Thanks,
Priyanka
priyankabachu@gmail.com
=======================================================
We are using Nagios Core 4.0.8 and we got a request to monitor for "Error" word in the log file on Unix server.
We tried configuring this service using check_log plugin .
=============================================
Check command in Service definition on host.cfg is as below:
check_command check_log_dc1uat163_oldone!-F /apps/wildfly-11.0.0/standalone/log/server.log.2019-06-20 -O /apps/wildfly-11.0.0/standalone/log/server.log -q "ERROR"
=======================================================
commands.cfg is below:
define command{
command_name check_log_dc1uat163_oldone
command_line $USER2$/check_log $ARG1$ $ARG2$ $ARG3$
}
=========================
However it is giving error as below:
Log check error: Log file /apps/wildfly-11.0.0/standalone/log/server.log.2019-06-20 does not exist!
Can someone pls suggest how to configure for this kind of monitoring.
Thanks,
Priyanka
priyankabachu@gmail.com
=======================================================
-
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Nagios Core - LogFile Monitoring in Unix server
Hi Priyanka,
Are your sure you have the correct file path as it cannot find it. Does the Nagios user on the server have permissions to access the log file?
Let me know. Thanks.
Are your sure you have the correct file path as it cannot find it. Does the Nagios user on the server have permissions to access the log file?
Code: Select all
su nagios
ls -l /apps/wildfly-11.0.0/standalone/log/server.log.2019-06-20
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Nagios Core - LogFile Monitoring in Unix server
Hi Smith,
Thanks for your prompt response.
Yes we are able to perform steps you provided.
[root@dc1uat163 ~]# su nagios
[nagios@dc1uat163 root]$ ls -l /apps/wildfly-11.0.0/standalone/log/server.log.2019-06-20
-rw-r--r-- 1 root root 30182209 Jun 20 23:59 /apps/wildfly-11.0.0/standalone/log/server.log.2019-06-20
===================
Please suggest how to proceed further.
Thanks for your prompt response.
Yes we are able to perform steps you provided.
[root@dc1uat163 ~]# su nagios
[nagios@dc1uat163 root]$ ls -l /apps/wildfly-11.0.0/standalone/log/server.log.2019-06-20
-rw-r--r-- 1 root root 30182209 Jun 20 23:59 /apps/wildfly-11.0.0/standalone/log/server.log.2019-06-20
===================
Please suggest how to proceed further.
-
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Nagios Core - LogFile Monitoring in Unix server
Hi,
If the file is there, then you'll need to change the permissions to allow access by the nagios user account. For the check_log plugin, do this for both files in your check command.
For example,
If the file is there, then you'll need to change the permissions to allow access by the nagios user account. For the check_log plugin, do this for both files in your check command.
For example,
Code: Select all
chgrp nagios /apps/wildfly-11.0.0/standalone/log/server.log.2019-06-20
chmod 770 /apps/wildfly-11.0.0/standalone/log/server.log.2019-06-20
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Nagios Core - LogFile Monitoring in Unix server
Hi Smith,
Yes we did tried changing permissions for the file as per your suggestion.But we are getting same error.
Could you please help us know if any other way to configure similar kind of monitoring.
Please suggest.
Regards,
Priyanka
priyankabachu@gmail.com
Yes we did tried changing permissions for the file as per your suggestion.But we are getting same error.
Could you please help us know if any other way to configure similar kind of monitoring.
Please suggest.
Regards,
Priyanka
priyankabachu@gmail.com
-
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Nagios Core - LogFile Monitoring in Unix server
Hello,
Log into /usr/local/nagios/libexec on the Nagios server and running the following command:
and provide a screenshot or post the output. If the file exists and Nagios has access to the file it should work.
Log into /usr/local/nagios/libexec on the Nagios server and running the following command:
Code: Select all
./check_log -F /apps/wildfly-11.0.0/standalone/log/server.log.2019-06-20 -O /apps/wildfly-11.0.0/standalone/log/server.log -q "error"
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Nagios Core - LogFile Monitoring in Unix server
Hi Smith,
I am getting below error.
./check_log: line 76: ./utils.sh: No such file or directory
Also attaching check_log plugin which we are using. PFA and suggest.
Thanks & Regards,
Priyanka Bachu
I am getting below error.
./check_log: line 76: ./utils.sh: No such file or directory
Also attaching check_log plugin which we are using. PFA and suggest.
Thanks & Regards,
Priyanka Bachu
- Attachments
-
- check_log.txt
- (6.13 KiB) Downloaded 175 times
Re: Nagios Core - LogFile Monitoring in Unix server
It needs to be run from within the directory that contains utils.sh, please do it this way:
Code: Select all
su - nagios
cd /usr/local/nagios/libexec/
./check_log -F /apps/wildfly-11.0.0/standalone/log/server.log.2019-06-20 -O /apps/wildfly-11.0.0/standalone/log/server.log -q "error"
Re: Nagios Core - LogFile Monitoring in Unix server
Hi ,
Please check the output below and please suggest.
I have run this command on the remote server.
[root@dc1uat163 ~]# su - nagios
[nagios@dc1uat163 ~]$ cd /usr/local/nagios/libexec/
[nagios@dc1uat163 libexec]$ ./check_log -F /apps/wildfly-11.0.0/standalone/log/server.log.2019-06-20 -O /apps/wildfly-11.0.0/standalone/log/server.log -q "error"
./check_log: line 209: /apps/wildfly-11.0.0/standalone/log/server.log: Permission denied
(59) < at bravura.sonata.application.useragent.UserAgent.errorDialog(UserAgent.java:105)[nagios@dc1uat163 libexec]$
Regards,
Priyanka
Please check the output below and please suggest.
I have run this command on the remote server.
[root@dc1uat163 ~]# su - nagios
[nagios@dc1uat163 ~]$ cd /usr/local/nagios/libexec/
[nagios@dc1uat163 libexec]$ ./check_log -F /apps/wildfly-11.0.0/standalone/log/server.log.2019-06-20 -O /apps/wildfly-11.0.0/standalone/log/server.log -q "error"
./check_log: line 209: /apps/wildfly-11.0.0/standalone/log/server.log: Permission denied
(59) < at bravura.sonata.application.useragent.UserAgent.errorDialog(UserAgent.java:105)[nagios@dc1uat163 libexec]$
Regards,
Priyanka
Re: Nagios Core - LogFile Monitoring in Unix server
It tells you the issue:
The nagios user doesn't have access to write to this file:
What are the permissions on there?
Code: Select all
./check_log: line 209: /apps/wildfly-11.0.0/standalone/log/server.log: Permission denied
Code: Select all
/apps/wildfly-11.0.0/standalone/log/server.log
Code: Select all
ls -l /apps/wildfly-11.0.0/standalone/log/server.log