尊龙凯时人生就是搏

ÔõÑùÔÚLinuxÉÏÉèÖüà¿Ø±¨¾¯

ÔõÑùÔÚlinuxÉÏÉèÖüà¿Ø±¨¾¯

ÔÚLinuxϵͳÖÐ £¬ÉèÖüà¿Ø±¨¾¯ÊǺÜÊÇÖ÷ÒªµÄ¡£Í¨¹ý¼à¿ØϵͳµÄÔËÐÐ״̬ £¬ÎÒÃÇ¿ÉÒÔʵʱ·¢Ã÷²¢½â¾öÎÊÌâ £¬´Ó¶ø°ü¹ÜϵͳµÄÎȹÌÐÔºÍÇå¾²ÐÔ¡£±¾ÎĽ«ÏÈÈÝÔõÑùÔÚlinuxÉÏÉèÖüà¿Ø±¨¾¯ £¬²¢ÌṩÏìÓ¦µÄ´úÂëʾÀý¡£

Ò»¡¢×°Öüà¿Ø¹¤¾ß

ÔÚLinuxϵͳÖÐ £¬ÓÐÐí¶à¼à¿Ø¹¤¾ß¿ÉÒÔʹÓà £¬ÈçNagios¡¢ZabbixµÈ¡£ÕâЩ¹¤¾ß¿ÉÒÔ¼à¿ØЧÀÍÆ÷µÄCPU¡¢ÄÚ´æ¡¢´ÅÅÌ¡¢ÍøÂçµÈ¸÷ÏîÖ¸±ê £¬²¢ÔÚ·ºÆðÒ쳣ʱ·¢Ëͱ¨¾¯ÐÅÏ¢¡£

ÒÔNagiosΪÀý £¬Ê×ÏÈÐèҪװÖÃNagiosЧÀÍÆ÷ºÍ¿Í»§¶ËÈí¼þ¡£ÔÚDebian/UbuntuϵͳÖÐ £¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁî×°Öãº

sudo apt-get install nagios3 nagios-nrpe-plugin

µÇ¼ºó¸´ÖÆ

×°ÖÃÍê³Éºó £¬»¹ÐèÒªÉèÖÃNagiosЧÀÍÆ÷ºÍ¿Í»§¶Ë¡£

¶þ¡¢ÉèÖÃNagiosЧÀÍÆ÷

ÔÚÉèÖÃNagiosЧÀÍÆ÷֮ǰ £¬ÐèÒªÏȽ¨ÉèÒ»¸ö¼à¿ØÉèÖÃÎļþ £¬ÒÔ½ç˵ÐèÒª¼à¿ØµÄÖ÷»úºÍЧÀÍ¡£ÔÚNagiosЧÀÍÆ÷µÄÉèÖÃÎļþ¼ÐÖÐ £¬ÕÒµ½/etc/nagios3/conf.dĿ¼ £¬²¢½¨ÉèÒ»¸öеÄÉèÖÃÎļþhosts.cfg £¬²¢ÔÚÆäÖÐÌí¼ÓÒÔÏÂÄÚÈÝ£º

define host {
    use                   linux-server
    host_name             server1
    alias                 My Server
    address               192.168.1.100
    }

define service{
    host_name             server1
    service_description   PING
    check_command         check_ping!100.0,20%!500.0,60%
    }

µÇ¼ºó¸´ÖÆ

ÒÔÉÏÉèÖÃÎļþ½ç˵ÁËÒ»¸öÃûΪserver1µÄÖ÷»ú £¬ËüµÄIPµØµãΪ192.168.1.100 £¬²¢¼à¿ØÁËÖ÷»úµÄPING״̬¡£

ÉèÖÃÍê³Éºó £¬ÖØÐÂÆô¶¯NagiosЧÀÍÆ÷¡£

sudo service nagios3 restart

µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ

Èý¡¢ÉèÖÃNagios¿Í»§¶Ë

ÔÚÒª¼à¿ØµÄLinuxЧÀÍÆ÷ÉÏ £¬ÐèҪװÖò¢ÉèÖÃNagios¿Í»§¶ËÈí¼þ¡£ÔÚDebian/UbuntuϵͳÖÐ £¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁî×°Öãº

sudo apt-get install nagios-nrpe-server

µÇ¼ºó¸´ÖÆ

×°ÖÃÍê³Éºó £¬»¹ÐèÒªÉèÖÃNagios¿Í»§¶Ë £¬ÒÔÔÊÐíNagiosЧÀÍÆ÷´ÓÔ¶³Ì¼à¿Ø¸ÃÖ÷»ú¡£

Ê×Ïȱ༭Nagios¿Í»§¶ËÉèÖÃÎļþ/etc/nagios/nrpe.cfg £¬²¢ÐÞ¸ÄÒÔϲÎÊý£º

allowed_hosts=127.0.0.1,192.168.1.1

µÇ¼ºó¸´ÖÆ

ÉÏÊö²ÎÊýÖÐ £¬192.168.1.1ÊÇNagiosЧÀÍÆ÷µÄIPµØµã £¬¿ÉÒÔƾ֤ÏÖÕæÏàÐξÙÐÐÐ޸ġ£

½ÓÏÂÀ´ £¬ÔÚ/etc/nagios/nrpe.dĿ¼Öн¨ÉèÒ»¸öеÄÉèÖÃÎļþlinux.cfg £¬²¢ÔÚÆäÖÐÌí¼ÓÒÔÏÂÄÚÈÝ£º

command[check_disk]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% /
command[check_load]=/usr/lib/nagios/plugins/check_load -w 5,4,3 -c 10,8,6

µÇ¼ºó¸´ÖÆ

ÒÔÉÏÉèÖÃÎļþ½ç˵ÁËÁ½¸öÏÂÁîcheck_diskºÍcheck_load £¬ÓÃÓÚ¼à¿Ø´ÅÅÌ¿Õ¼äºÍϵͳ¸ºÔØ¡£

ÉèÖÃÍê³Éºó £¬ÖØÐÂÆô¶¯Nagios¿Í»§¶Ë¡£

sudo service nagios-nrpe-server restart

µÇ¼ºó¸´ÖÆ

ËÄ¡¢²âÊÔ¼à¿Ø±¨¾¯

ÉèÖÃÍê³Éºó £¬¿ÉÒÔͨ¹ýNagiosµÄWeb½çÃæ £¬»òÕßʹÓÃnagios-pluginsÈí¼þ°üÖеÄÏÂÁî¾ÙÐвâÊÔ¡£

ÔÚNagiosЧÀÍÆ÷ÉÏ £¬¿ÉÒÔʹÓÃcheck_nrpeÏÂÁî²âÊÔ¿Í»§¶ËµÄÔËÐÐ״̬¡£ÀýÈç £¬¼ì²é¿Í»§¶ËÊÇ·ñ¿ÉÒÔÔËÐÐcheck_diskÏÂÁ

/usr/lib/nagios/plugins/check_nrpe -H 192.168.1.100 -c check_disk

µÇ¼ºó¸´ÖÆ

ÈôÊÇÏÂÁî·µ»ØÕý³£ £¬ÔòÌåÏÖ¼à¿ØÉèÖÃÀֳɡ£

ÔÚNagios¿Í»§¶ËÉÏ £¬¿ÉÒÔʹÓÃnagios-pluginsÈí¼þ°üÖеÄÏÂÁî²âÊÔϵͳµÄÔËÐÐ״̬¡£ÀýÈç £¬¼ì²é´ÅÅ̿ռ䣺

/usr/lib/nagios/plugins/check_disk -w 20% -c 10% /

µÇ¼ºó¸´ÖÆ

ÈôÊÇ´ÅÅÌ¿Õ¼äµÍÓÚ20%»òÕßµÍÓÚ10% £¬Ôò»á´¥·¢±¨¾¯¡£

Îå¡¢ÉèÖñ¨¾¯

ÉèÖüà¿Ø±¨¾¯Ê± £¬ÍùÍùÐèÒªÖ¸¶¨±¨¾¯µÄ·½·¨ºÍÎüÊÕÕß¡£ÔÚNagiosÖÐ £¬¿ÉÒÔͨ¹ý±à¼­/etc/nagios3/conf.d/contacts.cfgÎļþÀ´ÉèÖñ¨¾¯µÄÁªÏµÈË¡£

ÀýÈç £¬¿ÉÒÔÌí¼ÓÒÔÏÂÄÚÈÝÀ´½ç˵һ¸ö±¨¾¯ÁªÏµÈË£º

define contact{
    contact_name           admin
    alias                  Nagios Administrator
    email                  admin@example.com
    }

µÇ¼ºó¸´ÖÆ

ÒÔÉÏÉèÖýç˵ÁËÒ»¸öÃûΪadminµÄ±¨¾¯ÁªÏµÈË £¬ÆäÓÊÏäΪadmin@example.com¡£

½ÓÏÂÀ´ £¬ÔÚ/etc/nagios3/conf.d/hosts.cfgÎļþÖÐ £¬ÎªÖ÷»úÌí¼Ó±¨¾¯ÁªÏµÈË£º

define host{
    ...
    contacts               admin
    }

µÇ¼ºó¸´ÖÆ

ÉèÖÃÍê³Éºó £¬ÐèÒªÖØÐÂÆô¶¯NagiosЧÀÍÆ÷¡£

sudo service nagios3 restart

µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ

Áù¡¢×ܽá

ͨ¹ýÒÔÉÏ°ì·¨ £¬ÎÒÃÇ¿ÉÒÔÔÚLinuxϵͳÉÏÉèÖüà¿Ø±¨¾¯¡£Í¨¹ý¼à¿Ø¹¤¾ßµÄ×ÊÖú £¬ÎÒÃÇ¿ÉÒÔʵʱ·¢Ã÷²¢½â¾öϵͳÖеÄÎÊÌâ £¬°ü¹ÜϵͳµÄÎȹÌÐԺͿɿ¿ÐÔ¡£ËäÈ» £¬ÔÚÏÖʵӦÓÃÖÐ £¬ÐèҪƾ֤ÏêϸÇéÐε÷½â¼à¿ØÖ¸±êºÍ±¨¾¯·½·¨ £¬ÒÔÖª×ãÏÖʵÐèÇó¡£

ÒÔÉϾÍÊÇÔõÑùÔÚLinuxÉÏÉèÖüà¿Ø±¨¾¯µÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í尊龙凯时人生就是搏ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ尊龙凯时人生就是搏ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是搏

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
sitemap¡¢ÍøÕ¾µØͼ