nagios为监控图像添加图片

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).



posted @   KEL  阅读(872)  评论(0编辑  收藏  举报
编辑推荐:
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
阅读排行:
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· [AI/GPT/综述] AI Agent的设计模式综述
点击右上角即可分享
微信分享提示