本文整理汇总了PHP中ossim_db::opennms_connect方法的典型用法代码示例。如果您正苦于以下问题:PHP ossim_db::opennms_connect方法的具体用法?PHP ossim_db::opennms_connect怎么用?PHP ossim_db::opennms_connect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ossim_db
的用法示例。
在下文中一共展示了ossim_db::opennms_connect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: less_stable_services
function less_stable_services()
{
global $NUM_HOSTS;
/* opennms db connect */
$opennms_db = new ossim_db();
$opennms_conn = $opennms_db->opennms_connect();
$query = OssimQuery("SELECT servicename, count(servicename) \n FROM ifservices ifs, service s \n WHERE ifs.serviceid = s.serviceid AND ifs.status = 'D' \n GROUP BY servicename ORDER BY count(servicename) DESC \n LIMIT {$NUM_HOSTS}");
$rs =& $opennms_conn->Execute($query);
if (!$rs) {
print $opennms_conn->ErrorMsg();
} else {
?>
<h2><?php
echo _("Top");
?>
<?php
echo "{$NUM_HOSTS}";
?>
<?php
echo _("less stable services");
?>
</h2>
<table align="center">
<tr>
<th> <?php
echo gettext("Service");
?>
</th>
<th> <?php
echo gettext("Ocurrences");
?>
</th>
</tr>
<?php
while (!$rs->EOF) {
$service = $rs->fields["servicename"];
$occurrences = number_format($rs->fields["count"], 0, ",", ".");
?>
<tr>
<td><?php
echo $service;
?>
</td>
<td><?php
echo $occurrences;
?>
</td>
</tr>
<?php
$rs->MoveNext();
}
}
$opennms_db->close($opennms_conn);
echo "</table><br/>\n";
}