Skip to content

Instantly share code, notes, and snippets.

@brodul
Last active August 29, 2015 13:59
Show Gist options
  • Save brodul/10983822 to your computer and use it in GitHub Desktop.
Save brodul/10983822 to your computer and use it in GitHub Desktop.
ossec check
import os, time
root_log_dir = "/opt/ossec/logs/alerts"
months = [
(1, 'January'),
(2, 'February'),
(3, 'March'),
(4, 'April'),
(5, 'May'),
(6, 'June'),
(7, 'July'),
(8, 'August'),
(9, 'September'),
(10, 'October'),
(11, 'November'),
(12, 'December')
]
years = [int(year) for year in os.listdir(root_log_dir) if len(year) == 4]
latest_year = max(*years)
latest_dir = os.join(root_log_dir, latest_year)
days = [ (day, time.ctime(os.path.getctime(os.path(latest_dir, day))) )for day in os.listdir(latest_dir)]
import pdb; pdb.set_trace()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment