资源简介
Nagios SNMP Plugins package contains two plugins to be used with Nagios
代码片段和文件信息
/*************************************************************************
*
* plugins for Nagios
*
* (C) 2002-2008
* Henning P. Schmiedehausen
* INTERmeta - Gesellschaft fuer Mehrwertdienste mbH
* Hutweide 15
* D-91054 Buckenhof
*
*************************************************************************
*
* Checks the disks for a given host via snmp and the
* ucd snmp interface.
*
*************************************************************************
*
* Distributed under GPL.
*
* $Id: disk_plugin.cv 1.6 2002/01/27 22:10:24 henning Exp $
*
*/
#include “snmp_common.h“
#define RCS_VERSION “$Revision: 1.6 $ ($Date: 2002/01/27 22:10:24 $)“
#define DISK_INDEX_MIB “.1.3.6.1.4.1.2021.9.1.1“
#define DISK_PATH_MIB “.1.3.6.1.4.1.2021.9.1.2“
#define DISK_DEVICE_MIB “.1.3.6.1.4.1.2021.9.1.3“
#define DISK_MINIMUM_MIB “.1.3.6.1.4.1.2021.9.1.4“
#define DISK_MINPERCENT_MIB “.1.3.6.1.4.1.2021.9.1.5“
#define DISK_TOTAL_MIB “.1.3.6.1.4.1.2021.9.1.6“
#define DISK_AVAIL_MIB “.1.3.6.1.4.1.2021.9.1.7“
#define DISK_USED_MIB “.1.3.6.1.4.1.2021.9.1.8“
#define DISK_PERCENT_MIB “.1.3.6.1.4.1.2021.9.1.9“
#define DISK_PERCENTNODE_MIB “.1.3.6.1.4.1.2021.9.1.10“
#define DISK_ERRORFLAG_MIB “.1.3.6.1.4.1.2021.9.1.100“
#define DISK_ERRORMSG_MIB “.1.3.6.1.4.1.2021.9.1.101“
int report_disk(void);
int main (int argc char *argv[])
{
static struct option long_options[] = {
{ “help“ no_argument 0 ‘h‘ }
{ “version“ no_argument 0 ‘V‘ }
{ “timeout“ required_argument 0 ‘t‘ }
{ “community“ required_argument 0 ‘C‘ }
{ “hostname“ required_argument 0 ‘H‘ }
{ “verbose“ no_argument 0 ‘v‘ }
{ “list“ no_argument 0 ‘l‘ }
{ 0 0 0 0 }
};
int option_index = 0;
int c;
int ret = STATE_UNKNOWN;
bn = strdup(basename(argv[0]));
version = VERSION;
#define OPTS “?hVvlt:c:w:C:H:“
while(1)
{
c = getopt_long(argc argv OPTS long_options &option_index);
if(c == -1 || c == EOF)
break;
switch(c)
{
case ‘?‘:
case ‘h‘:
print_help();
exit(STATE_UNKNOWN);
case ‘V‘:
print_version();
exit(STATE_UNKNOWN);
case ‘t‘:
if(!is_integer(optarg))
{
printf(“%s: Timeout interval (%s)must be integer!\n“
bn
optarg);
exit(STATE_UNKNOWN);
}
timeout = atoi(optarg);
if(verbose)
printf(“%s: Timeout set to %d\n“ bn timeout);
break;
case ‘C‘:
community = strdup(optarg);
if(verbose)
printf(“%s: Community set to %s\n“ bn community);
break;
case ‘H‘:
hostname = strdup(optarg);
if(verbose)
printf(“%s: Hostname set to %s\n“ bn hostname);
break;
case ‘v‘:
verbose = 1;
printf(“%s: Verbose mode activated\n“
- 上一篇:数字电路课程设计四位串行乘法器
- 下一篇:Debian学习笔记
相关资源
- SNMP实验报告
- 用net-snmp的api实现trap接收,windows+li
- net-snmp开始教程
- myeclipse插件图形化安装工具-包Create
- 彻底禁用Chrome插件停用开发者模式提
- mib2中节点的详细中文描述
- OD关键字高亮插件_AsmHighlight.rar
- Qt 使用插件Plugins扩展应用程序简单
- snmp4j中文版阅读文档
- 用snmp4j获取本地所有oid
- ntkoplugins的插件
- Getif 2.3.1.zip
- bimserver1.5.182 plugins.zip
- H3C最新MIB库-2018
- 通信设备MIB之cisco思科最新全套私有
- apache-jmeter-5.1.1、JMeterPlugins-Standard-1
- 华为服务器ibmc snmp mib
- CISCO相当全的MIB库
- linux下的snmp测试脚本
- Python利用SNMP读取交换机端口信息及状
- free mybatis plugins
- 基于SNMP协议的网络拓扑发现程序
- 毕业论文:基于SNMP/MIB的信息采集
- snmp监控华为S5700 zabbix模板
评论
共有 条评论