Analyse log files


#1

Hi,

I use the Nagios plug-in check_log to check my log files for suspecious entires.
However, the module avails with the error message that the log files are not readable.
For example:
-rw-r----- 1 root adm 36490 Dec 14 15:31 /var/log/messages

It is just readable for root and adm but not for the user “nagios” who, as I assume, is
executing the Nagios plug-ins. So, how can I solve the permission problem?

Another problem I have since I installed Nagios are strange entries in my /var/log/messages:

*nagios: Error: Could not connect to MySQL database ‘’ on host ‘’ using username ‘’ and password ‘XXXXXX’. Retention data will not be processed or saved!
nagios: Error: Could not re-connect to database server on host ‘’ for status data. I’ll keep trying every 60 seconds…
*
Where do they come from and how can I solve them?

Best regards,
Chris


#2

What nagios version are you running? I suppose you could add user nagios to the adm group in the /etc/group file.


#3

I’m using Nagio v1.3


#4

nagios.sourceforge.net/docs/1_0/xdata-db.html

In the CGI config file, you need to add the following directives (the downtime_file directive in the main configuration file is no longer used)…

xdddb_host=database_host
xdddb_port=database_port
xdddb_username=database_user
xdddb_password=database_password
xdddb_database=database_name

These are fairly self-explanatory. They are used by the CGIs to identify the address of your database server (and the port it is running on), the name of the database in which the downtime entries should be stored, and the username/password that should be used when connecting to the databse server. Nagios will assume that two tables (as defined here) exist in this database for storage of downtime data. Note: The CGIs only need read access to the downtime data, so this user should only have SELECT privileges on the comment tables.

In a resource file, you need to add the following directives…

xdddb_host=database_host
xdddb_port=database_port
xdddb_username=database_user
xdddb_password=database_password
xdddb_database=database_name
xdddb_optimize_data=[0/1]