1、nagiosql 配置
nagiosql 與 默認 nagios 的手動編輯只能選擇一種,所以要先修改nagios.cfg文件中對應內容如下所示:
#cfg_file=/etc/nagios/objects/commands.cfg
#cfg_file=/etc/nagios/objects/contacts.cfg
#cfg_file=/etc/nagios/objects/timeperiods.cfg
#cfg_file=/etc/nagios/objects/templates.cfg
cfg_dir=/etc/nagios/nagiosql
#cfg_dir=/etc/nagios/instance
進入nagiosql web 頁面
2、配置導入
選擇如下配置進行導入
/etc/nagios/objects/commands.cfg
/etc/nagios/objects/contacts.cfg
/etc/nagios/objects/timeperiods.cfg
/etc/nagios/objects/templates.cfg
/etc/nagios/instance/commands.cfg
/etc/nagios/instance/groups.cfg
/etc/nagios/instance/hosts.cfg
/etc/nagios/instance/services.cfg
/etc/nagios/instance/templates.cfg、
3、添加主機
4、添加服務
注意上述圖中有紅色標記的位置,爲必選
5、應用生效
從上向下依次點擊,對存在疑問的進行處理,至重啓nagios 後,監控目標生效;