- where can I find file you mentioned - 'htmltocsv.py' ?
- is it somehow possible to consider warnings and scheduled downtimes as OK states? (just like [ ] Hide scheduled downtime option in availability reports)
..and bonus question
Thanks for help.
Code: Select all
yum install python-beautifulsoup4Code: Select all
#!/usr/bin/python
from bs4 import BeautifulSoup
import sys
import re
import csv
def cell_text(cell):
return " ".join(cell.stripped_strings)
soup = BeautifulSoup(sys.stdin.read())
output = csv.writer(sys.stdout)
for table in soup.find_all('table'):
for row in table.find_all('tr'):
col = map(cell_text, row.find_all(re.compile('t[dh]')))
output.writerow(col)
output.writerow([])Code: Select all
"time_ok": 2527907,
"time_warning": 0,
"time_critical": 132493,
"time_unknown": 0,
"scheduled_time_ok": 0,
"scheduled_time_warning": 0,
"scheduled_time_critical": 411,
"scheduled_time_unknown": 0,
"time_indeterminate_nodata": 0,
"time_indeterminate_notrunning": 0Code: Select all
/usr/local/nagios/bin/nagios -VCode: Select all
Nagios Core 4.1.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-19-2015
License: GPL
Website: https://www.nagios.org
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.