Move nagios.log files to thruk instead logcache

(Padma) #1

logcache is consuming huge memory and hanging and gets internal server error while trying to fetch log from webinterface.

Hence need your help to move nagios.log files to thruk and make thruk to work with nagios log file format.

(Sven Nierlein) #2

the logcache is optional, you don’t have to use it. It’s not even enabled by default. If disabled, Thruk will fetch the logs via livestatus. Just disable the logcache in your thruk_local.conf.

(Padma) #3

Thank you @ Sven Nierlein for your initiative in helping me

Sorry for confusion . Actually when i tried with livestatus while fetching the report my nagios server faced severe latency issue . Then as per suggestion in the link https://www.thruk.org/documentation/logfile-cache.html i have implemented the logcache method .

i have 4 different nagios instance . I copied log files from nagion to thruk server (separate server) and imported to the 4 different Tables .

Issue: When i try to update the new log file for next day am getting the following error .

ERROR DETAIL: DBD::mysql::db do failed: Duplicate entry ‘14447’ for key ‘PRIMARY’
ERROR SQL: INSERT INTO cb938_service (service_id, host_id, service_description) VALUES(14447, 1444,‘Eventlog-system’)
DBD::mysql::db do failed: Duplicate entry ‘14448’ for key ‘PRIMARY’ at /usr/share/thruk/lib/Thruk/Backend/Provider/Mysql.pm line 2137, <$fh> line 57354.

ERROR DETAIL: DBD::mysql::db do failed: Duplicate entry ‘14227’ for key ‘PRIMARY’
ERROR SQL: INSERT INTO cb938_plugin_output (output_id, output) VALUES(14227, ‘OK - 10.10.10.10: rta 25.050ms, lost 0%’)
DBD::mysql::db do failed: Duplicate entry ‘14228’ for key ‘PRIMARY’ at /usr/share/thruk/lib/Thruk/Backend/Provider/Mysql.pm line 2137, <$fh> line 354.

(Sven Nierlein) #4

There is usually no need to fiddle with the logfiles itself. Livestatus caches the logfiles for the current day which increases the memory footprint of Nagios and leads indeed to latency issues with nagios 3. However this should not be an issue with more modern cores like Naemon or Nagios 4.

If you really want to import the manually synced logfiles, tell me which commands you actually did run.