nagios为监控图像添加图片

本文档介绍了如何在Nagios监控系统中为主机添加个性化图标,以提高监控界面的美观度。首先从官方资源库下载图片并上传至服务器,然后在Nagios配置文件中设置`statusmap_image`和`icon_image`参数,分别用于状态地图和主机显示。最后重启Nagios服务使设置生效。注意,推荐使用GD2格式的图片以减少CPU负载,且图标尺寸建议为40x40像素。
摘要由CSDN通过智能技术生成

1、 背景介绍

    在监控web页面上显示主机都为问号,如下图所示:


      本文的主要目的就是将监控的图片添加进去,让监控图像变得美观。

2、 图片的下载地址

图片的下载地址如下:

https://exchange.nagios.org/directory/Graphics-and-Logos/Images-and-Logos

图片下载之后,解压缩上传的服务器路径如下:


3、 nagios设置

可以设置图标的配置文件如下:


主要可以设置的地方就是定义主机的地方,如下所示:


也可以在模板中进行定义,如下所示:


    两个参数的说明的如下:

     参数icon_image主要是用来设置鼠标在悬浮状态下信息显示的时候有图标出现


参数statusmap_image主要用来设置在map选项界面中的图标,如下所示:


4、 重启nagios

在进行设置完成之后,重启nagios服务即可:


5、几个需要注意的地方

statusmap_image:

此图标用来定义在状态图的时候的图标,可以使用的格式为JPEG,PNG和GIF,在使用这些格式的时候,会占用大量的CPU时间,从而推荐使用gd2格式的图形。

icon_image:

此图标可以使用的格式为jpeg,PNG和GIF格式图形,主要用来显示和主机有关的界面。

icon_image: This variable is used to define the name of a GIF, PNG, orJPG image that should be associated with this host. This image will bedisplayed in the various places in the CGIs. The image will look best if it is40x40 pixels in size. Images for hosts are assumed to be in the logos/subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).

statusmap_image: This variable is used to define the name of an image thatshould be associated with this host in the statusmap CGI. You can specify a JPEG, PNG, and GIFimage if you want, although I would strongly suggest using a GD2 format image,as other image formats will result in a lot of wasted CPU time when thestatusmap image is generated. GD2 images can be created from PNG images by usingthe pngtogd2 utility supplied with Thomas Boutell's gd library. The GD2 images should be created in uncompressed formatin order to minimize CPU load when the statusmap CGI is generating the networkmap image. The image will look best if it is 40x40 pixels in size. You canleave these option blank if you are not using the statusmap CGI. Images forhosts are assumed to be in the logos/ subdirectory in your HTML imagesdirectory (i.e. /usr/local/nagios/share/images/logos).



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值