close
最後再加上各節點機所運行的平台資訊
#!/usr/bin/perl
use DBI;
$dbh = DBI->connect('dbi:mysql:database=opsview;host=172.16.69.27','enfuzion','12345678');
$sql = "select platform from `enfuzion_node_status` where host like '$ARGV[0]'";
$sth = $dbh->prepare($sql);
$sth->execute || die "Could not execute SQL statement ... maybe invalid? \n\n $sql \n";
@row=$sth->fetchrow_array;
if (defined (@row) != 1) ## 如果找不到資料,就顯示 unknown,並設定狀況為 Critical
{
@row = unknown;
print "CRITICAL: Node is in @row\n";
exit 2;
}
else
{
print "OK: Node is in @row\n";
}
全站熱搜
留言列表