我有一个安装了check_nrpe插件的监控服务器和一个我想监控的远程服务器。远程机器具有NRPE插件并安装了几个命令。我可以问一下远程服务器安装了多少命令和哪种命令?
答案 0 :(得分:2)
不要认为有一种直接的方法可以检查远程服务器上安装的命令数量,而是可以编写一个插件,使用 nrpe来抓取特定模式<p class="field-content-multiple description description-wide">
<select name="menu-item-content-multiple[<?php echo $item_id; ?>][]" id="edit-menu-item-content-multiple-<?php echo $item_id; ?>" class="widefat code edit-menu-item-content-multiple bsnselect" multiple>
<?php foreach (self::$YPE_multiple as $key => $value): ?>
<option value="<?php echo $key; ?>" <?php echo selected(in_array($key, $item->content_multiple)); ?>><?php echo $value;?> </option>
<?php endforeach ?>
</select>
</p>
<p class="field-custom-category description description-wide">
<label for="edit-menu-item-custom-category-<?php echo $item_id; ?>">
<?php _e( 'Select specific categories' ); ?><br />
<select name="menu-item-custom-category[<?php echo $item_id; ?>][]" id="edit-menu-item-custom-category-<?php echo $item_id; ?>" class="widefat code edit-menu-item-custom-category bsnselect" multiple>
<?php
$YPE_cats = get_categories();
foreach ($YPE_cats as $YPE_cat) { ?>
<option value="<?php echo $YPE_cat->slug; ?>" <?php echo selected(in_array($YPE_cat->slug, $item->custom_category)); ?>><?php echo $YPE_cat->name;?></option><?php
}
?>
</select>
</label>
</p>
<p class="field-custom-tag description description-wide">
<label for="edit-menu-item-custom-tag-<?php echo $item_id; ?>">
<?php _e( 'Select specific tags' ); ?><br />
<select name="menu-item-custom-tag[<?php echo $item_id; ?>][]" id="edit- menu-item-custom-tag-<?php echo $item_id; ?>" class="widefat code edit-menu- item-custom-tag bsnselect" multiple>
<?php
$YPE_tags = get_tags();
foreach ($YPE_tags as $YPE_tag) { ?>
<option value="<?php echo $YPE_tag->slug; ?>" <?php echo selected(in_array($YPE_tag->slug, $item->custom_tag)); ?>><?php echo $YPE_tag->name;?></option><?php
}
?>
</select>
</label>
</p>
。 cfg ,它为您提供远程主机/服务器中的命令数