| Cheshire Cat Computing http://steveshipway.org/forum/ |
|
| Loadlog.pl: loads empty tables http://steveshipway.org/forum/viewtopic.php?f=20&t=8084 |
Page 1 of 1 |
| Author: | jcnbac [ Fri Jan 04, 2013 1:28 am ] |
| Post subject: | Loadlog.pl: loads empty tables |
| Author: | stevesh [ Fri Jan 04, 2013 2:39 pm ] |
| Post subject: | Re: Loadlog.pl: loads empty tables |
It is doing exactly what you told it to do. The -T tells it to create the tables, which it has done. However, you've given it no logfile names to load in.... Run 'loadlogs.pl -h' to get the help page and syntax. You should do something like 'loadlogs.pl -q -T -S /usr/local/nagios/var/archive/*.log' to load in all the files in the archive directory. It will not load in again a file that has been successfully read in previously. |
|
| Author: | jcnbac [ Sat Jan 05, 2013 11:27 am ] |
| Post subject: | Re: Loadlog.pl: loads empty tables |
Thank you Steve, I was able to use the plugin following your guidelines. In the first run, I used only the option -T (to create tables) and then again ran the plugin with the option -t (for charging all types of information), and option -f (to reload the log file). I noticed that the option -T and option -t can not be used together, since the option -t requires the presence of the table loaded. However, the information provided by the plugin loadlogs.pl not meet my needs (at least that's what I can gather). I would like to manipulate the information provided by reporting option Nagios: event start time, end time event, event durantion, event/state type, event/state information and put them in a database. Do you have any idea how I can do this? |
|
| Author: | stevesh [ Sat Jan 05, 2013 5:30 pm ] |
| Post subject: | Re: Loadlog.pl: loads empty tables |
Unfortunately, this sort of information is not directly available in the logs. The loadlogs program loads the log entries into the database, one per entry - the entries do not specify event duration, end time, and so on. The only way to obtain this info is to analyse the logs and calculate it - this is full of difficulties since you need to identify multiple related log entries to calculate the state duration. Nagios' logging system is very sub-optimal in this regard. The loadlogs program attempts to perform this sort of analysis and create a summary table from the detail table; you of course need to load in the detail data first before it can do this! Load in some archived log files to get the summary data calculated. |
|
| Author: | jcnbac [ Mon Jan 07, 2013 3:59 pm ] |
| Post subject: | Re: Loadlog.pl: loads empty tables |
Hello Stive, I think the information EVENT START TIME and END TIME EVENT will be on file status.dat available. Since every 15s status.dat file is updated, I think the first step would be to run a script that stores the results of data collected in a specific location. Second step: how to do the calculation to determine the time intervals and duration of events UP and DOWN. |
|
| Author: | stevesh [ Tue Jan 08, 2013 7:51 pm ] |
| Post subject: | Re: Loadlog.pl: loads empty tables |
The info you mention is in status.dat; however only for the current state. The loadlogs program loads in the nagios.log logfile entries of historical events and this information is not available for them. If you want to use the data in status.dat you would need a constantly-running application (or a nagios daemon plugin) to monitor current state and forward it to a database. That would be something completely different (though very useful). |
|
| Page 1 of 1 | All times are UTC + 12 hours [ DST ] |
| Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |
|