资源简介
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学习笔记
相关资源
- 用VC 编写的基于SNMP的路由器拓扑程序
- checkpoint的snmp及syslog配置.doc
- dellmib库snmp获取dell服务器信息的
- SNMP安装包(全+使用文档)
- snmpc7.0中文版网管软件
- net-snmp-5.6.1.1-1.x86.exe
- Linux安装SNMP服务所需要rpm包
- plugins.rar
- Windows 10 1903 SNMP离线安装文件.rar
- JMeterPlugins-Standard-1.4.0.zip
- SNMP测试工具
- snmp++-3.3.11a 库相关文件及编译笔记
- nginx服务器插件之net-snmp-5.6.1.1.tar.gz
- 基于SNMP/MIB的网络数据获取系统设计
- net-snmp-5.5.0-2.x64.EXE
- PPAPI 开发接口
- 非常好的snmp测试工具 实现了snmp的获
- SNMP_开发包和培训资料
- JMeterPlugins-Standard-1.4.0.zip,ServerAgent
- megacli-8.00.48_linux_32-64
- AdventNetSNMP的API
- SNMP大全--snmp4j(get trapset取mib)
- snmp4j中agent程序demo
- H3C的MIB snmp
- 简易好用的snmp测试工具
- snmp服务XP系统安装包
-
ob
jectSNMP - Nagios源码 和中文帮助文档
- snmp连接测试工具
- pnp4nagios-0.6.25.tar.gz
评论
共有 条评论