Merge "implements: blueprint synchronizer-nagios-get-all"

This commit is contained in:
Jenkins 2016-02-21 11:25:19 +00:00 committed by Gerrit Code Review
commit 30ffba8565
4 changed files with 520 additions and 0 deletions

View File

@ -4,6 +4,7 @@
pbr>=1.6
Babel>=1.3
lxml>=2.3
python-dateutil>=2.4.2
python-novaclient>=2.26.0
networkx>=1.10

View File

@ -6,6 +6,7 @@ hacking<0.11,>=0.10.0
python-dateutil>=2.4.2
coverage>=3.6
discover
lxml>=2.3
networkx>=1.10
python-novaclient>=2.26.0
python-subunit>=0.0.18

View File

@ -0,0 +1,430 @@
<html>
<head>
<link rel="shortcut icon" href="/monitoring/nagios/images/favicon.ico" type="image/ico">
<title>
Current Network Status
</title>
<link rel='stylesheet' type='text/css' href='/monitoring/nagios/stylesheets/common.css' />
<link rel='stylesheet' type='text/css' href='/monitoring/nagios/stylesheets/status.css' />
<script type='text/javascript' src='/monitoring/nagios/js/jquery-1.7.1.min.js'></script>
<script type='text/javascript'>
$(document).ready(function() { $('#top_page_numbers').append($('#bottom_page_numbers').html() ); });function set_limit(url) {
this.location = url+'&limit='+$('#limit').val();
}</script>
</head>
<body class='status'>
<!-- Produced by Nagios (http://www.nagios.org). Copyright (c) 1999-2007 Ethan Galstad. -->
<script src="/monitoring/pnp4nagios/media/js/jquery-min.js" type="text/javascript"></script>
<script src="/monitoring/pnp4nagios/media/js/jquery.cluetip.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function() {
jQuery('a.tips').cluetip({ajaxCache: false, dropShadow: false,showTitle: false });
});
</script>
<table class='headertable'>
<tr>
<td align=left valign=top width=33%>
<TABLE CLASS='infoBox' BORDER=1 CELLSPACING=0 CELLPADDING=0>
<TR><TD CLASS='infoBox'>
<DIV CLASS='infoBoxTitle'>Current Network Status</DIV>
Last Updated: Wed Feb 17 15:22:05 IST 2016<BR>
Updated every 90 seconds<br>
Nagios&reg; Core&trade; 3.5.0 - <A HREF='http://www.nagios.org' TARGET='_new' CLASS='homepageURL'>www.nagios.org</A><BR>
Logged in as <i>nagiosadmin</i><BR>
</TD></TR>
</TABLE>
<table class='linkBox'>
<tr><td class='linkBox'>
<a href='history.cgi?host=all'>View History For all hosts</a><br>
<a href='notifications.cgi?host=all'>View Notifications For All Hosts</a>
<br /><a href='status.cgi?hostgroup=all&style=hostdetail'>View Host Status Detail For All Hosts</a>
</td></tr>
</table>
</td>
<td align=center valign=top width=33%>
<div class='hostTotals'>Host Status Totals</div>
<table border=0 cellspacing=0 cellpadding=0>
<tr><td>
<table class='hostTotals'>
<tr>
<th class='hostTotals'><a class='hostTotals' href='status.cgi?host=all&hoststatustypes=2'>Up</a></th>
<th class='hostTotals'><a class='hostTotals' href='status.cgi?host=all&hoststatustypes=4'>Down</a></th>
<th class='hostTotals'><a class='hostTotals' href='status.cgi?host=all&hoststatustypes=8'>Unreachable</a></th>
<th class='hostTotals'><a class='hostTotals' href='status.cgi?host=all&hoststatustypes=1'>Pending</a></th>
</tr>
<tr>
<td class='hostTotalsUP'>24</td>
<td class='hostTotalsDOWN'>2</td>
<td class='hostTotals'>0</td>
<td class='hostTotals'>0</td>
</tr>
</table>
</td></tr><tr><td align='center'>
<table class='hostTotals'>
<tr>
<th class='hostTotals'><a class='hostTotals' href='status.cgi?host=all&hoststatustypes=12'><em>All Problems</em></a></th>
<th class='hostTotals'><a class='hostTotals' href='status.cgi?host=all'><em>All Types</em></a></th>
</tr><tr>
<td class='hostTotalsPROBLEMS'>2</td>
<td class='hostTotals'>26</td>
</tr>
</table>
</td></tr>
</table>
</div>
</td>
<td align=center valign=top width=33%>
<div class='serviceTotals'>Service Status Totals</div>
<table border='0' cellspacing='0' cellpadding='0'>
<tr><td>
<table class='serviceTotals'>
<tr>
<th class='serviceTotals'><a class='serviceTotals' href='status.cgi?host=all&servicestatustypes=2&hoststatustypes=15'>Ok</a></th>
<th class='serviceTotals'><a class='serviceTotals' href='status.cgi?host=all&servicestatustypes=4&hoststatustypes=15'>Warning</a></th>
<th class='serviceTotals'><a class='serviceTotals' href='status.cgi?host=all&servicestatustypes=8&hoststatustypes=15'>Unknown</a></th>
<th class='serviceTotals'><a class='serviceTotals' href='status.cgi?host=all&servicestatustypes=16&hoststatustypes=15'>Critical</a></th>
<th class='serviceTotals'><a class='serviceTotals' href='status.cgi?host=all&servicestatustypes=1&hoststatustypes=15'>Pending</a></th>
</tr>
<tr>
<td class='serviceTotalsOK'>742</td>
<td class='serviceTotalsWARNING'>7</td>
<td class='serviceTotalsUNKNOWN'>1</td>
<td class='serviceTotalsCRITICAL'>7</td>
<td class='serviceTotals'>0</td>
</tr>
</table>
</td></tr><tr><td align='center'>
<table class='serviceTotals'>
<tr>
<th class='serviceTotals'><a class='serviceTotals' href='status.cgi?host=all&servicestatustypes=28&hoststatustypes=15'><em>All Problems</em></a></th>
<th class='serviceTotals'><a class='serviceTotals' href='status.cgi?host=all&hoststatustypes=15'><em>All Types</em></a></th>
</tr><tr>
<td class='serviceTotalsPROBLEMS'>15</td>
<td class='serviceTotals'>757</td>
</tr>
</table>
</td></tr>
</table>
</div>
</td>
<td align=right valign=bottom>
</td>
</tr>
</table>
<table class='pageTitle' border='0' width='100%'>
<tr>
<td valign=top align=left width=33%>
</td><td valign=top align=center width=33%>
<div align='center' class='statusTitle'>Service Status Details For All Hosts</div>
<br></td>
<td valign=top align=right width=33%></td>
</tr>
</table>
<div id='pagelimit'>
<div id='result_limit'>
<label for='limit'>Limit Results: </label>
<select onchange='set_limit("status.cgi?host=all")' name='limit' id='limit'>
<option value='50'>50</option>
<option value='100'>100</option>
<option value='250'>250</option>
<option value='1000'>1000</option>
<option selected='selected' value='0'>All</option>
</select></div>
<div id='top_page_numbers'></div>
</div>
<table border=0 width=100% class='status'>
<tr>
<th class='status'>Host&nbsp;<a href='status.cgi?host=all&sorttype=1&sortoption=1'><IMG SRC='/monitoring/nagios/images/up.gif' border=0 ALT='Sort by host name (ascending)' TITLE='Sort by host name (ascending)'></a><a href='status.cgi?host=all&sorttype=2&sortoption=1'><IMG SRC='/monitoring/nagios/images/down.gif' border=0 ALT='Sort by host name (descending)' TITLE='Sort by host name (descending)'></a></th><th class='status'>Service&nbsp;<a href='status.cgi?host=all&sorttype=1&sortoption=2'><IMG SRC='/monitoring/nagios/images/up.gif' border=0 ALT='Sort by service name (ascending)' TITLE='Sort by service name (ascending)'></a><a href='status.cgi?host=all&sorttype=2&sortoption=2'><IMG SRC='/monitoring/nagios/images/down.gif' border=0 ALT='Sort by service name (descending)' TITLE='Sort by service name (descending)'></a></th><th class='status'>Status&nbsp;<a href='status.cgi?host=all&sorttype=1&sortoption=3'><IMG SRC='/monitoring/nagios/images/up.gif' border=0 ALT='Sort by service status (ascending)' TITLE='Sort by service status (ascending)'></a><a href='status.cgi?host=all&sorttype=2&sortoption=3'><IMG SRC='/monitoring/nagios/images/down.gif' border=0 ALT='Sort by service status (descending)' TITLE='Sort by service status (descending)'></a></th><th class='status'>Last Check&nbsp;<a href='status.cgi?host=all&sorttype=1&sortoption=4'><IMG SRC='/monitoring/nagios/images/up.gif' border=0 ALT='Sort by last check time (ascending)' TITLE='Sort by last check time (ascending)'></a><a href='status.cgi?host=all&sorttype=2&sortoption=4'><IMG SRC='/monitoring/nagios/images/down.gif' border=0 ALT='Sort by last check time (descending)' TITLE='Sort by last check time (descending)'></a></th><th class='status'>Duration&nbsp;<a href='status.cgi?host=all&sorttype=1&sortoption=6'><IMG SRC='/monitoring/nagios/images/up.gif' border=0 ALT='Sort by state duration (ascending)' TITLE='Sort by state duration (ascending)'></a><a href='status.cgi?host=all&sorttype=2&sortoption=6'><IMG SRC='/monitoring/nagios/images/down.gif' border=0 ALT='Sort by state duration time (descending)' TITLE='Sort by state duration time (descending)'></a></th><th class='status'>Attempt&nbsp;<a href='status.cgi?host=all&sorttype=1&sortoption=5'><IMG SRC='/monitoring/nagios/images/up.gif' border=0 ALT='Sort by current attempt (ascending)' TITLE='Sort by current attempt (ascending)'></a><a href='status.cgi?host=all&sorttype=2&sortoption=5'><IMG SRC='/monitoring/nagios/images/down.gif' border=0 ALT='Sort by current attempt (descending)' TITLE='Sort by current attempt (descending)'></a></th><th class='status'>Status Information</th>
</tr>
<tr>
<td class='statusEven'><table border=0 width='100%' cellpadding=0 cellspacing=0>
<tr>
<td align='left'>
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td align=left valign=center class='statusEven'><a href='extinfo.cgi?type=1&host=compute-0-0.local' title='10.1.255.253'>compute-0-0.local</a></td>
</tr>
</table>
</td>
<td align=right valign=center>
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td align=center valign=center><a href='/monitoring/pnp4nagios/index.php/graph?host=compute-0-0.local&srv=_HOST_' class='tips' rel='/monitoring/pnp4nagios/index.php/popup?host=compute-0-0.local&srv=_HOST_' TARGET='main'><IMG SRC='/monitoring/nagios/images/action.gif' border=0 WIDTH=20 HEIGHT=20 ALT='Perform Extra Host Actions' TITLE='Perform Extra Host Actions'></a></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td class='statusBGWARNING'><table border=0 WIDTH='100%' cellspacing=0 cellpadding=0><tr><td align='left'><table border=0 cellspacing=0 cellpadding=0>
<tr>
<td align='left' valign=center class='statusBGWARNING'><a href='extinfo.cgi?type=2&host=compute-0-0.local&service=CPU+load'>CPU load</a></td></tr>
</table>
</td>
<td ALIGN=RIGHT class='statusBGWARNING'>
<table border=0 cellspacing=0 cellpadding=0>
<tr>
<td ALIGN=center valign=center><a href='extinfo.cgi?type=2&host=compute-0-0.local&service=CPU+load'><IMG SRC='/monitoring/nagios/images/disabled.gif' border=0 WIDTH=20 HEIGHT=20 ALT='Active and passive checks have been disabled for this service' TITLE='Active and passive checks have been disabled for this service'></a></td><td align=center valign=center><a href='/monitoring/pnp4nagios/index.php/graph?host=compute-0-0.local&srv=CPU load' class='tips' rel='/monitoring/pnp4nagios/index.php/popup?host=compute-0-0.local&srv=CPU load' TARGET='main'><IMG SRC='/monitoring/nagios/images/action.gif' border=0 WIDTH=20 HEIGHT=20 ALT='Perform Extra Service Actions' TITLE='Perform Extra Service Actions'></a></td>
</tr>
</table>
</td>
</tr></table></td>
<td class='statusWARNING'>WARNING</td>
<td class='statusBGWARNING' nowrap>2016-02-09 13:05:32</td>
<td class='statusBGWARNING' nowrap> 8d 2h 16m 33s</td>
<td class='statusBGWARNING'>1/1</td>
<td class='statusBGWARNING' valign='center'>high CPU load&nbsp;</td>
</tr>
<tr>
<td></td>
<td class='statusOdd'><table border=0 WIDTH='100%' cellspacing=0 cellpadding=0><tr><td align='left'><table border=0 cellspacing=0 cellpadding=0>
<tr>
<td align='left' valign=center class='statusOdd'><a href='extinfo.cgi?type=2&host=compute-0-0.local&service=CPU+utilization'>CPU utilization</a></td></tr>
</table>
</td>
<td ALIGN=RIGHT class='statusOdd'>
<table border=0 cellspacing=0 cellpadding=0>
<tr>
<td ALIGN=center valign=center><a href='extinfo.cgi?type=2&host=compute-0-0.local&service=CPU+utilization'><IMG SRC='/monitoring/nagios/images/passiveonly.gif' border=0 WIDTH=20 HEIGHT=20 ALT='Active checks of the service have been disabled - only passive checks are being accepted' TITLE='Active checks of the service have been disabled - only passive checks are being accepted'></a></td><td align=center valign=center><a href='/monitoring/pnp4nagios/index.php/graph?host=compute-0-0.local&srv=CPU utilization' class='tips' rel='/monitoring/pnp4nagios/index.php/popup?host=compute-0-0.local&srv=CPU utilization' TARGET='main'><IMG SRC='/monitoring/nagios/images/action.gif' border=0 WIDTH=20 HEIGHT=20 ALT='Perform Extra Service Actions' TITLE='Perform Extra Service Actions'></a></td>
</tr>
</table>
</td>
</tr></table></td>
<td class='statusOK'>OK</td>
<td class='statusOdd' nowrap>2016-02-17 15:21:22</td>
<td class='statusOdd' nowrap>14d 1h 29m 34s</td>
<td class='statusOdd'>1/1</td>
<td class='statusOdd' valign='center'>OK - user: 0.5%, system: 0.4%, wait: 2.4%, total: 3.3%&nbsp;</td>
</tr>
<tr>
<td></td>
<td class='statusOdd'><table border=0 WIDTH='100%' cellspacing=0 cellpadding=0><tr><td align='left'><table border=0 cellspacing=0 cellpadding=0>
<tr>
<td align='left' valign=center class='statusOdd'><a href='extinfo.cgi?type=2&host=compute-0-0.local&service=Disk+IO+SUMMARY'>Disk IO SUMMARY</a></td></tr>
</table>
</td>
<td ALIGN=RIGHT class='statusOdd'>
<table border=0 cellspacing=0 cellpadding=0>
<tr>
<td ALIGN=center valign=center><a href='extinfo.cgi?type=2&host=compute-0-0.local&service=Disk+IO+SUMMARY'><IMG SRC='/monitoring/nagios/images/passiveonly.gif' border=0 WIDTH=20 HEIGHT=20 ALT='Active checks of the service have been disabled - only passive checks are being accepted' TITLE='Active checks of the service have been disabled - only passive checks are being accepted'></a></td><td align=center valign=center><a href='/monitoring/pnp4nagios/index.php/graph?host=compute-0-0.local&srv=Disk IO SUMMARY' class='tips' rel='/monitoring/pnp4nagios/index.php/popup?host=compute-0-0.local&srv=Disk IO SUMMARY' TARGET='main'><IMG SRC='/monitoring/nagios/images/action.gif' border=0 WIDTH=20 HEIGHT=20 ALT='Perform Extra Service Actions' TITLE='Perform Extra Service Actions'></a></td>
</tr>
</table>
</td>
</tr></table></td>
<td class='statusOK'>OK</td>
<td class='statusOdd' nowrap>2016-02-17 15:21:22</td>
<td class='statusOdd' nowrap>14d 1h 28m 34s</td>
<td class='statusOdd'>1/1</td>
<td class='statusOdd' valign='center'>OK - 0.00 B/sec read, 1.84 MB/sec write, IOs: 89.00/sec&nbsp;</td>
</tr>
<tr>
<td class='statusEven'><table border=0 width='100%' cellpadding=0 cellspacing=0>
<tr>
<td align='left'>
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td align=left valign=center class='statusEven'><a href='extinfo.cgi?type=1&host=compute-0-1.local' title='10.1.255.252'>compute-0-1.local</a></td>
</tr>
</table>
</td>
<td align=right valign=center>
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td align=center valign=center><a href='/monitoring/pnp4nagios/index.php/graph?host=compute-0-1.local&srv=_HOST_' class='tips' rel='/monitoring/pnp4nagios/index.php/popup?host=compute-0-1.local&srv=_HOST_' TARGET='main'><IMG SRC='/monitoring/nagios/images/action.gif' border=0 WIDTH=20 HEIGHT=20 ALT='Perform Extra Host Actions' TITLE='Perform Extra Host Actions'></a></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td class='statusEven'><table border=0 WIDTH='100%' cellspacing=0 cellpadding=0><tr><td align='left'><table border=0 cellspacing=0 cellpadding=0>
<tr>
<td align='left' valign=center class='statusEven'><a href='extinfo.cgi?type=2&host=compute-0-1.local&service=CPU+load'>CPU load</a></td></tr>
</table>
</td>
<td ALIGN=RIGHT class='statusEven'>
<table border=0 cellspacing=0 cellpadding=0>
<tr>
<td ALIGN=center valign=center><a href='extinfo.cgi?type=2&host=compute-0-1.local&service=CPU+load'><IMG SRC='/monitoring/nagios/images/passiveonly.gif' border=0 WIDTH=20 HEIGHT=20 ALT='Active checks of the service have been disabled - only passive checks are being accepted' TITLE='Active checks of the service have been disabled - only passive checks are being accepted'></a></td><td align=center valign=center><a href='/monitoring/pnp4nagios/index.php/graph?host=compute-0-1.local&srv=CPU load' class='tips' rel='/monitoring/pnp4nagios/index.php/popup?host=compute-0-1.local&srv=CPU load' TARGET='main'><IMG SRC='/monitoring/nagios/images/action.gif' border=0 WIDTH=20 HEIGHT=20 ALT='Perform Extra Service Actions' TITLE='Perform Extra Service Actions'></a></td>
</tr>
</table>
</td>
</tr></table></td>
<td class='statusOK'>OK</td>
<td class='statusEven' nowrap>2016-02-17 15:21:22</td>
<td class='statusEven' nowrap> 0d 1h 48m 43s</td>
<td class='statusEven'>1/1</td>
<td class='statusEven' valign='center'>OK - 15min load 1.27 at 24 CPUs&nbsp;</td>
</tr>
<tr>
<td></td>
<td class='statusOdd'><table border=0 WIDTH='100%' cellspacing=0 cellpadding=0><tr><td align='left'><table border=0 cellspacing=0 cellpadding=0>
<tr>
<td align='left' valign=center class='statusOdd'><a href='extinfo.cgi?type=2&host=compute-0-1.local&service=CPU+utilization'>CPU utilization</a></td></tr>
</table>
</td>
<td ALIGN=RIGHT class='statusOdd'>
<table border=0 cellspacing=0 cellpadding=0>
<tr>
<td ALIGN=center valign=center><a href='extinfo.cgi?type=2&host=compute-0-1.local&service=CPU+utilization'><IMG SRC='/monitoring/nagios/images/passiveonly.gif' border=0 WIDTH=20 HEIGHT=20 ALT='Active checks of the service have been disabled - only passive checks are being accepted' TITLE='Active checks of the service have been disabled - only passive checks are being accepted'></a></td><td align=center valign=center><a href='/monitoring/pnp4nagios/index.php/graph?host=compute-0-1.local&srv=CPU utilization' class='tips' rel='/monitoring/pnp4nagios/index.php/popup?host=compute-0-1.local&srv=CPU utilization' TARGET='main'><IMG SRC='/monitoring/nagios/images/action.gif' border=0 WIDTH=20 HEIGHT=20 ALT='Perform Extra Service Actions' TITLE='Perform Extra Service Actions'></a></td>
</tr>
</table>
</td>
</tr></table></td>
<td class='statusOK'>OK</td>
<td class='statusOdd' nowrap>2016-02-17 15:21:22</td>
<td class='statusOdd' nowrap>14d 1h 29m 19s</td>
<td class='statusOdd'>1/1</td>
<td class='statusOdd' valign='center'>OK - user: 0.5%, system: 0.4%, wait: 2.2%, total: 3.1%&nbsp;</td>
</tr>
<tr>
<td></td>
<td class='statusBGCRITICAL'><table border=0 WIDTH='100%' cellspacing=0 cellpadding=0><tr><td align='left'><table border=0 cellspacing=0 cellpadding=0>
<tr>
<td align='left' valign=center class='statusBGCRITICAL'><a href='extinfo.cgi?type=2&host=compute-0-1.local&service=check_load'>check_load</a></td></tr>
</table>
</td>
<td ALIGN=RIGHT class='statusBGCRITICAL'>
<table border=0 cellspacing=0 cellpadding=0>
<tr>
<td ALIGN=center valign=center><a href='extinfo.cgi?type=2&host=compute-0-1.local&service=check_load'><IMG SRC='/monitoring/nagios/images/disabled.gif' border=0 WIDTH=20 HEIGHT=20 ALT='Active and passive checks have been disabled for this service' TITLE='Active and passive checks have been disabled for this service'></a></td><td align=center valign=center><a href='/monitoring/pnp4nagios/index.php/graph?host=compute-0-1.local&srv=check_load' class='tips' rel='/monitoring/pnp4nagios/index.php/popup?host=compute-0-1.local&srv=check_load' TARGET='main'><IMG SRC='/monitoring/nagios/images/action.gif' border=0 WIDTH=20 HEIGHT=20 ALT='Perform Extra Service Actions' TITLE='Perform Extra Service Actions'></a></td>
</tr>
</table>
</td>
</tr></table></td>
<td class='statusCRITICAL'>CRITICAL</td>
<td class='statusBGCRITICAL' nowrap>2016-02-16 14:27:06</td>
<td class='statusBGCRITICAL' nowrap> 1d 0h 54m 59s</td>
<td class='statusBGCRITICAL'>1/1</td>
<td class='statusBGCRITICAL' valign='center'>Critical Error&nbsp;</td>
</tr>
<tr>
<td class='statusEven'><table border=0 width='100%' cellpadding=0 cellspacing=0>
<tr>
<td align='left'>
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td align=left valign=center class='statusEven'><a href='extinfo.cgi?type=1&host=os-ceilometer-00.local' title='10.1.20.57'>os-ceilometer-00.local</a></td>
</tr>
</table>
</td>
<td align=right valign=center>
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td align=center valign=center><a href='/monitoring/pnp4nagios/index.php/graph?host=os-ceilometer-00.local&srv=_HOST_' class='tips' rel='/monitoring/pnp4nagios/index.php/popup?host=os-ceilometer-00.local&srv=_HOST_' TARGET='main'><IMG SRC='/monitoring/nagios/images/action.gif' border=0 WIDTH=20 HEIGHT=20 ALT='Perform Extra Host Actions' TITLE='Perform Extra Host Actions'></a></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td class='statusEven'><table border=0 WIDTH='100%' cellspacing=0 cellpadding=0><tr><td align='left'><table border=0 cellspacing=0 cellpadding=0>
<tr>
<td align='left' valign=center class='statusEven'><a href='extinfo.cgi?type=2&host=os-ceilometer-00.local&service=CPU+load'>CPU load</a></td></tr>
</table>
</td>
<td ALIGN=RIGHT class='statusEven'>
<table border=0 cellspacing=0 cellpadding=0>
<tr>
<td ALIGN=center valign=center><a href='extinfo.cgi?type=2&host=os-ceilometer-00.local&service=CPU+load'><IMG SRC='/monitoring/nagios/images/passiveonly.gif' border=0 WIDTH=20 HEIGHT=20 ALT='Active checks of the service have been disabled - only passive checks are being accepted' TITLE='Active checks of the service have been disabled - only passive checks are being accepted'></a></td><td align=center valign=center><a href='/monitoring/pnp4nagios/index.php/graph?host=os-ceilometer-00.local&srv=CPU load' class='tips' rel='/monitoring/pnp4nagios/index.php/popup?host=os-ceilometer-00.local&srv=CPU load' TARGET='main'><IMG SRC='/monitoring/nagios/images/action.gif' border=0 WIDTH=20 HEIGHT=20 ALT='Perform Extra Service Actions' TITLE='Perform Extra Service Actions'></a></td>
</tr>
</table>
</td>
</tr></table></td>
<td class='statusOK'>OK</td>
<td class='statusEven' nowrap>2016-02-17 15:21:51</td>
<td class='statusEven' nowrap>14d 0h 48m 4s</td>
<td class='statusEven'>1/1</td>
<td class='statusEven' valign='center'>OK - 15min load 0.36 at 2 CPUs&nbsp;</td>
</tr>
<tr>
<td></td>
<td class='statusOdd'><table border=0 WIDTH='100%' cellspacing=0 cellpadding=0><tr><td align='left'><table border=0 cellspacing=0 cellpadding=0>
<tr>
<td align='left' valign=center class='statusOdd'><a href='extinfo.cgi?type=2&host=os-ceilometer-00.local&service=CPU+utilization'>CPU utilization</a></td></tr>
</table>
</td>
<td ALIGN=RIGHT class='statusOdd'>
<table border=0 cellspacing=0 cellpadding=0>
<tr>
<td ALIGN=center valign=center><a href='extinfo.cgi?type=2&host=os-ceilometer-00.local&service=CPU+utilization'><IMG SRC='/monitoring/nagios/images/passiveonly.gif' border=0 WIDTH=20 HEIGHT=20 ALT='Active checks of the service have been disabled - only passive checks are being accepted' TITLE='Active checks of the service have been disabled - only passive checks are being accepted'></a></td><td align=center valign=center><a href='/monitoring/pnp4nagios/index.php/graph?host=os-ceilometer-00.local&srv=CPU utilization' class='tips' rel='/monitoring/pnp4nagios/index.php/popup?host=os-ceilometer-00.local&srv=CPU utilization' TARGET='main'><IMG SRC='/monitoring/nagios/images/action.gif' border=0 WIDTH=20 HEIGHT=20 ALT='Perform Extra Service Actions' TITLE='Perform Extra Service Actions'></a></td>
</tr>
</table>
</td>
</tr></table></td>
<td class='statusOK'>OK</td>
<td class='statusOdd' nowrap>2016-02-17 15:21:51</td>
<td class='statusOdd' nowrap>14d 0h 48m 4s</td>
<td class='statusOdd'>1/1</td>
<td class='statusOdd' valign='center'>OK - user: 2.7%, system: 1.0%, wait: 0.1%, total: 3.8%&nbsp;</td>
</tr>
<tr>
<td class='statusEven'><table border=0 width='100%' cellpadding=0 cellspacing=0>
<tr>
<td align='left'>
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td align=left valign=center class='statusEven'><a href='extinfo.cgi?type=1&host=os-ceilometer-01.local' title='10.1.20.58'>os-ceilometer-01.local</a></td>
</tr>
</table>
</td>
<td align=right valign=center>
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td align=center valign=center><a href='/monitoring/pnp4nagios/index.php/graph?host=os-ceilometer-01.local&srv=_HOST_' class='tips' rel='/monitoring/pnp4nagios/index.php/popup?host=os-ceilometer-01.local&srv=_HOST_' TARGET='main'><IMG SRC='/monitoring/nagios/images/action.gif' border=0 WIDTH=20 HEIGHT=20 ALT='Perform Extra Host Actions' TITLE='Perform Extra Host Actions'></a></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td class='statusEven'><table border=0 WIDTH='100%' cellspacing=0 cellpadding=0><tr><td align='left'><table border=0 cellspacing=0 cellpadding=0>
<tr>
<td align='left' valign=center class='statusEven'><a href='extinfo.cgi?type=2&host=os-ceilometer-01.local&service=CPU+load'>CPU load</a></td></tr>
</table>
</td>
<td ALIGN=RIGHT class='statusEven'>
<table border=0 cellspacing=0 cellpadding=0>
<tr>
<td ALIGN=center valign=center><a href='extinfo.cgi?type=2&host=os-ceilometer-01.local&service=CPU+load'><IMG SRC='/monitoring/nagios/images/passiveonly.gif' border=0 WIDTH=20 HEIGHT=20 ALT='Active checks of the service have been disabled - only passive checks are being accepted' TITLE='Active checks of the service have been disabled - only passive checks are being accepted'></a></td><td align=center valign=center><a href='/monitoring/pnp4nagios/index.php/graph?host=os-ceilometer-01.local&srv=CPU load' class='tips' rel='/monitoring/pnp4nagios/index.php/popup?host=os-ceilometer-01.local&srv=CPU load' TARGET='main'><IMG SRC='/monitoring/nagios/images/action.gif' border=0 WIDTH=20 HEIGHT=20 ALT='Perform Extra Service Actions' TITLE='Perform Extra Service Actions'></a></td>
</tr>
</table>
</td>
</tr></table></td>
<td class='statusOK'>OK</td>
<td class='statusEven' nowrap>2016-02-17 15:21:51</td>
<td class='statusEven' nowrap>14d 0h 48m 2s</td>
<td class='statusEven'>1/1</td>
<td class='statusEven' valign='center'>OK - 15min load 0.44 at 2 CPUs&nbsp;</td>
</tr>
<tr>
<td></td>
<td class='statusOdd'><table border=0 WIDTH='100%' cellspacing=0 cellpadding=0><tr><td align='left'><table border=0 cellspacing=0 cellpadding=0>
<tr>
<td align='left' valign=center class='statusOdd'><a href='extinfo.cgi?type=2&host=os-ceilometer-01.local&service=CPU+utilization'>CPU utilization</a></td></tr>
</table>
</td>
<td ALIGN=RIGHT class='statusOdd'>
<table border=0 cellspacing=0 cellpadding=0>
<tr>
<td ALIGN=center valign=center><a href='extinfo.cgi?type=2&host=os-ceilometer-01.local&service=CPU+utilization'><IMG SRC='/monitoring/nagios/images/passiveonly.gif' border=0 WIDTH=20 HEIGHT=20 ALT='Active checks of the service have been disabled - only passive checks are being accepted' TITLE='Active checks of the service have been disabled - only passive checks are being accepted'></a></td><td align=center valign=center><a href='/monitoring/pnp4nagios/index.php/graph?host=os-ceilometer-01.local&srv=CPU utilization' class='tips' rel='/monitoring/pnp4nagios/index.php/popup?host=os-ceilometer-01.local&srv=CPU utilization' TARGET='main'><IMG SRC='/monitoring/nagios/images/action.gif' border=0 WIDTH=20 HEIGHT=20 ALT='Perform Extra Service Actions' TITLE='Perform Extra Service Actions'></a></td>
</tr>
</table>
</td>
</tr></table></td>
<td class='statusOK'>OK</td>
<td class='statusOdd' nowrap>2016-02-17 15:21:51</td>
<td class='statusOdd' nowrap>14d 0h 48m 2s</td>
<td class='statusOdd'>1/1</td>
<td class='statusOdd' valign='center'>OK - user: 2.7%, system: 1.1%, wait: 0.2%, total: 4.1%&nbsp;</td>
</tr>
</table>
<br /><div class='itemTotalsTitle'>Results 1 - 757 of 757 Matching Services</div>
</div>
<!-- Produced by Nagios (http://www.nagios.org). Copyright (c) 1999-2007 Ethan Galstad. -->
</body>
</html>

View File

@ -0,0 +1,88 @@
# Copyright 2016 - Nokia
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from oslo_log import log as logging
from vitrage.synchronizer.plugins.nagios.parser import NagiosParser
from vitrage.synchronizer.plugins.nagios.properties import NagiosProperties
from vitrage.tests import base
from vitrage.tests.mocks import utils
LOG = logging.getLogger(__name__)
class NagiosParserTest(base.BaseTest):
expected_service1 = {NagiosProperties.RESOURCE_NAME: 'compute-0-0.local',
NagiosProperties.SERVICE: 'CPU load',
NagiosProperties.STATUS: 'WARNING',
NagiosProperties.LAST_CHECK: '2016-02-09 13:05:32',
NagiosProperties.DURATION: ' 8d 2h 16m 33s',
NagiosProperties.ATTEMPT: '1/1',
NagiosProperties.STATUS_INFO:
u'high CPU load\xa0'}
expected_service2 = {NagiosProperties.RESOURCE_NAME: 'compute-0-1.local',
NagiosProperties.SERVICE: 'check_load',
NagiosProperties.STATUS: 'CRITICAL',
NagiosProperties.LAST_CHECK: '2016-02-16 14:27:06',
NagiosProperties.DURATION: ' 1d 0h 54m 59s',
NagiosProperties.ATTEMPT: '1/1',
NagiosProperties.STATUS_INFO:
u'Critical Error\xa0'}
expected_service3 = {NagiosProperties.RESOURCE_NAME: 'compute-0-0.local',
NagiosProperties.SERVICE: 'Disk IO SUMMARY',
NagiosProperties.STATUS: 'OK',
NagiosProperties.LAST_CHECK: '2016-02-17 15:21:22',
NagiosProperties.DURATION: '14d 1h 28m 34s',
NagiosProperties.ATTEMPT: '1/1',
NagiosProperties.STATUS_INFO:
u'OK - 0.00 B/sec read, 1.84 MB/sec write, '
u'IOs: 89.00/sec\xa0'}
def setUp(self):
super(NagiosParserTest, self).setUp()
def test_template_loader(self):
# Setup
fp = open(utils.get_resources_dir() + '/nagios/nagios-mock.html')
nagios_html = fp.read()
# Action
nagios_services = NagiosParser().parse(nagios_html)
# Test assertions
self.assertTrue(nagios_services)
self._assert_contains(nagios_services, self.expected_service1)
self._assert_contains(nagios_services, self.expected_service2)
self._assert_contains(nagios_services, self.expected_service3)
def _assert_contains(self, services, expected_service):
for service in services:
if service[NagiosProperties.RESOURCE_NAME] == \
expected_service[NagiosProperties.RESOURCE_NAME] and \
service[NagiosProperties.SERVICE] == \
expected_service[NagiosProperties.SERVICE]:
self._assert_expected_service(expected_service, service)
return
self.fail("service not found: %(resource_name)s %(service_name)s" %
{'resource_name':
expected_service[NagiosProperties.RESOURCE_NAME],
'service_name':
expected_service[NagiosProperties.SERVICE]})
def _assert_expected_service(self, expected_service, service):
for key, value in expected_service.items():
self.assertEqual(value, service[key], 'wrong value for ' + key)