91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

nagios監控windows

發布時間:2020-07-17 06:45:16 來源:網絡 閱讀:1288 作者:xi慣孤單 欄目:移動開發

監控windows主機

監控windows主機通過snmp或者nsclient++來監控

nagios監控windows

Nsclient++可以監控windows主機的cpu、內存、磁盤空間、進程、服務

Nsclient++也支持nrpe所以也可以通過nrpe來監控

NSCA主動與nagios發送檢測,nagios端也需要NSCA daemon

通常使用check_nt,也是最簡單,功能最少的。

nagios監控windows


安裝NSClient


nagios監控windows


nagios監控windows

Allowed hosts

Nagios所在的主機地址,我這里是192.168.102.128


Password:密碼


是否允許常見插件

是否允許check_nt

是否允許check_nrpe


關閉防火墻之后

上圖為安裝之后查看端口,12489監控0.0.0.0,即check_ntnsclient++通信的端口

5666nrpe所使用的端口


想要nagios監控windows

要安裝check_nt

[root@localhostnagios-cn-3.2.0]# cd /usr/local/nagios/libexec/

[root@localhostlibexec]#ls

[root@localhost libexec]# ./check_nt h            查看幫助。

[root@localhost libexec]# ./check_nt -H 192.168.102.132(被監控主機ip -p 12489 -v UPTIME

System Uptime - 0 day(s) 1 hour(s) 35 minute(s)                查看當前windows主機的啟動時間


[root@localhostlibexec]# ./check_nt -H 192.168.102.132 -p 12489 -v CPULOAD -w 80 -c 90 -l5,80,90

CPU Load2% (5 min average) |   '5 min avgLoad'=2%;80;90;0;100            

查看當前windows主機的cpu使用情況。



[root@localhostlibexec]# ./check_nt -H 192.168.102.132 -p 12489 -v USEDDISKSPACE -w 80 -c 90-l C

C:\ -total: 14.65 Gb - used: 9.72 Gb (66%) - free 4.93 Gb (34%) | 'C:\ UsedSpace'=9.72Gb;11.72;13.18;0.00;14.65

檢測C盤的利用率




計劃進行監控

[root@localhostobjects]# cd /etc/nagios/objects/

[root@localhostobjects]# ls

commands.cfg   localhost.cfg   switch.cfg      timeperiods.cfg

contacts.cfg   printer.cfg     templates.cfg   windows.cfg


[root@localhost objects]# vim commands.cfg            在個加入新的命令。

definecommand{

       command_name check_nt

       command_line $USER1$/check_nt -H$HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$


}【源文件已經有了】

[root@localhost objects]# vim windows.cfg                定義主機

修改:


可以用vim命令:

.,$s@winserver@winhost@g

.        ,       $s    @winserver    @winhost        @g

當前行最后一行搜索 winserver    用其替換前面    go

【修改主機名,可以不進行修改】

[root@localhost objects]# vim windows.cfg


# Createa service for monitoring the W3SVC service

# Changethe host_name to match the name of the host you defined above


defineservice{

       use                     generic-service

       host_name               winhost

       service_description     W3SVC

       check_command           check_nt!SERVICESTATE!-d SHOWALL -lW3SVC

       }




# Createa service for monitoring the Explorer.exe process

# Changethe host_name to match the name of the host you defined above


defineservice{

       use                     generic-service

       host_name               winhost

       service_description     Explorer

       check_command           check_nt!PROCSTATE!-d SHOWALL -lExplorer.exe

       }


"windows.cfg" 145L, 4005C                                                  134,0-1      底端


最后啟用此配置文件:

[root@localhostobjects]# cd ..

[root@localhostnagios]# vim nagios.cfg


# You canspecify individual object config files as shown below:

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_file=/etc/nagios/objects/windows.cfg                添加



重啟之前,檢查語法錯誤。


[root@localhost nagios]# /usr/local/nagios/bin/nagios -v/etc/nagios/nagios.cfg


Nagios Core 3.2.0

Copyright (c) 2009 Nagios Core Development Team and CommunityContributors

Copyright (c) 1999-2009 Ethan Galstad

Last Modified: 08-12-2009

License: GPL


Website: http://www.nagios.org

Reading configuration data...

  Read main config fileokay...

Processing object config file '/etc/nagios/objects/commands.cfg'...

Warning: Duplicate definition found for command 'check_nt' (configfile '/etc/nagios/objects/     ommands.cfg', starting on line 241)

Error: Could not add object property in file'/etc/nagios/objects/commands.cfg' on line 242.【有問題了】

  Error processing objectconfig files!



***> One or more problems was encountered while processing theconfig files...


    Check your configurationfile(s) to ensure that they contain valid

    directives and datadefintions.  If you are upgrading from aprevious

    version of Nagios, youshould be aware that some variables/definitions

    may have been removed ormodified in this version.  Make sure toread

    the HTML documentationregarding the config files, as well as the

    'Whats New' section tofind out what has changed.



檢查原因是那里重復了。


再進行檢測

[root@localhost nagios]# /usr/local/nagios/bin/nagios -v/etc/nagios/nagios.cfg


Nagios Core 3.2.0

Copyright (c) 2009 Nagios Core Development Team and CommunityContributors

Copyright (c) 1999-2009 Ethan Galstad

Last Modified: 08-12-2009

License: GPL


Website: http://www.nagios.org

Reading configuration data...

  Read main config fileokay...

Processing object config file '/etc/nagios/objects/commands.cfg'...

Processing object config file '/etc/nagios/objects/contacts.cfg'...

Processing object config file'/etc/nagios/objects/timeperiods.cfg'...

Processing object config file '/etc/nagios/objects/templates.cfg'...

Processing object config file '/etc/nagios/objects/windows.cfg'...

Processing object config file '/etc/nagios/objects/localhost.cfg'...

  Read object config filesokay...


Running pre-flight check on configuration data...


Checking services...

       Checked 26 services.

Checking hosts...

       Checked 12 hosts.

Checking host groups...

       Checked 3 host groups.

Checking service groups...

       Checked 2 servicegroups.

Checking contacts...

       Checked 1 contacts.

Checking contact groups...

       Checked 1 contactgroups.

Checking service escalations...

       Checked 0 serviceescalations.

Checking service dependencies...

       Checked 0 servicedependencies.

Checking host escalations...

       Checked 0 hostescalations.

Checking host dependencies...

       Checked 0 hostdependencies.

Checking commands...

       Checked 24 commands.

Checking time periods...

       Checked 5 timeperiods.

Checking for circular paths between hosts...

Checking for circular host and service dependencies...

Checking global event handlers...

Checking obsessive compulsive processor commands...

Checking misc settings...


Total Warnings: 0

Total Errors:   0


Things look okay - No serious problems were detected during thepre-flight check



沒有錯誤。


[root@localhost nagios]# service nagios restart

Running configuration check...done.

Stopping nagios: done.

Starting nagios: done.


重啟服務,加載新的配置文件。

nagios監控windows

最后:



對多臺windows主機進行監控:

#cp windows.cfg winserver.cfg

然后修改ip

再把definegroup的注釋掉

添加到監控計劃中。

重啟服務。



nagios監控windows








向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

奇台县| 许昌市| 太和县| 建德市| 蓬溪县| 潮安县| 顺平县| 元谋县| 苍山县| 宝兴县| 吉林省| 仁化县| 白水县| 宣武区| 黎川县| 平和县| 烟台市| 汉寿县| 安龙县| 稻城县| 崇信县| 平罗县| 峨山| 镇安县| 大理市| 曲周县| 正定县| 大同市| 曲松县| 三亚市| 通辽市| 江达县| 竹溪县| 武川县| 通江县| 铜山县| 台湾省| 长沙市| 天峻县| 奉贤区| 许昌县|