pnp4nagios画图出现 XML file XXXX not found 问题
来源:互联网 发布:调研数据分析报告模板 编辑:程序博客网 时间:2024/06/05 10:15
前几天写了一篇使用pnp4nagios为nagios画图的文章,后来发现有些脚本的图像并不能画图来,下面来提出解决思路。
错误现象:
错误原因:
这种情况大多数是由于自己编写的nagios插件造成的,pnp4nagios画图必须遵循特定的信息输出格式,不然就不会产生图像。
这种输出格式就是
TEXT_OUTPUT_SEEN_ON_NAGIOS_WEB | label=value[UOM];[warn];[crit];[min];
label =图形的人类可读名称标签
value =检查输出的数值当前值
UOM=图像Y轴的单位
warn =检查waring的阈值
crit = 检查critical的阈值
min = 图像Y轴的最小值
max =图表Y轴的最大值
管道(|)之后的所有数据将被隐藏在Nagios Web GUI中。这些数据只适用于Pnp4Nagios性能数据图形,Nagios Web GUI用户不可见。但是,如果您将在Nagios Client或Nagios Server上从命令行本地运行Nagios Plugin Bash脚本,则此数据将可见。所以在自编写的插件上输出的报警内容 要按照这个格式输出,否则就会产生如题的错误。
解决办法:
下面是一个check_open_files.sh实例脚本,可以参考
#!/bin/bash# Nagios Plugin Bash Script - check_open_files.sh# This script checks the number of currently opened files for the specified user with the specified WARNING and CRITICAL threshold## Check for missing parametersif [[ -z "$1" ]] || [[ -z "$2" ]] || [[ -z "$3" ]]; then echo "Missing parameters! Syntax: ./check_open_files.sh USER WARNING_THRESHOLD CRITICAL_THRESHOLD" exit 2fi# Check for number of currently opened filesofiles=$(sudo /usr/sbin/lsof |grep $1 |grep REG |wc -l)# Check if number of currently opened files is lower than WARNING threshold parameterif [[ "$ofiles" -lt "$2" ]]; then echo "OK - Number of open files is $ofiles | NumOpenFiles=$ofiles;$2;$3;0;10000" exit 0fi# Check if number of currently opened files is greater than WARNING threshold parameter and lower than CRITICAL threshold parameterif [[ "$ofiles" -gt "$2" ]] && [[ "$ofiles" -lt "$3" ]]; then echo "WARNING - Number of open files is $ofiles | NumOpenFiles=$ofiles;$2;$3;0;10000" exit 1fi# Check if number of currently opened files is greater than CRITICAL threshold parameterif [[ "$ofiles" -gt "$3" ]]; then echo "CRITICAL - Number of open files is $ofiles | NumOpenFiles=$ofiles;$2;$3;0;10000" exit 2fi
阅读全文
0 0
- pnp4nagios画图出现 XML file XXXX not found 问题
- iOS "xxxx" file not found
- 关于C语言画图出现Device driver file not found EGAVGA.BGI问题
- ReactNative出现错误问题'React/RCTBridgeModule.h' file not found
- IOS引用三方framewrok的头文件出现'xxxxx/xxxx.h' file not found问题解决方法
- IOS引用三方framewrok的头文件出现'xxxxx/xxxx.h' file not found问题解决方法
- CocoaPods更新出现file not found.
- GitHub push时出现“remote:Repository not found .repository ‘https://github.com/xxxx/xxx’ not found”
- 安装pnp4nagios时出现Pango-WARNING **: error opening config file '/home/www/.pangorc': Not a directory错误
- iOS常见错误3-Xcode导入第三方库 'MAMapKit/MAMapKit.h' file not found('XXXX/XXXX.h' file not found)错误
- Swift code into Object-C 出现 ***-swift have not found this file 的问题
- nagios使用pnp4nagios画图
- HWI WAR file not found问题
- 解决“cstdlib file not found”问题
- 'DTCoreText/DTCoreText.h' file not found 问题
- hadoop+spark:error :file not found问题
- Hibernate 中出现 XXXX is not mapped 问题
- Hibernate 中出现 XXXX is not mapped 问题
- JSP常用标签——JSTL标签和EL表达式
- Android studio中使用butterknife注解
- 移动支付--微信公众号支付开发
- 线程的五种状态详解
- Android中Kotlin语言构造函数的使用
- pnp4nagios画图出现 XML file XXXX not found 问题
- maven如何引入自定义jar或第三方jar
- Java高级软件工程师面试题
- 【USACO TRAINING】子集的和
- rn笔记:关于const {val} 与 const val
- UE4学习笔记14th:组件和碰撞
- 嵌入式高效编程小技巧
- WPF 实现数据结构对象与UI控件的绑定
- python中PIL安装教程