设为首页 收藏本站
查看: 1258|回复: 0

nagios check_disk:DISK CRITICAL - /root/.gvfs is not accessible: Permission ...

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2016-10-13 10:16:11 | 显示全部楼层 |阅读模式
                        nagios check_disk:DISK CRITICAL - /root/.gvfs is not accessible: Permission denied
1
2

[iyunv@S-BDB-136 ~]# /usr/local/nagios/libexec/check_nrpe -H localhost -c check_disk
DISK CRITICAL - /root/.gvfs is not accessible: Permission denied

用nagios的check_disk可以在本机成功,但是如果用check_nrpe来调用check_disk命令的话就会出现上述错误:
1
DISK CRITICAL - /root/.gvfs is not accessible: Permission denied



有些人会直接删除这个文件来确保自己监控的成功,但是我觉得这样是不合理的,总不能一言不合就把文件给删了吧。所以,我研究了下可以用下列命令来实现
1
command[check_disk]=/usr/local/nagios/libexec/check_disk -w 30% -c 20% -X nfs -X mvfs -A -i '.gvfs'



忽略.gvfs,来看看check_disk的参数
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
[iyunv@bjjk ~]# /usr/local/nagios/libexec/check_disk --help                     
check_disk v1.4.15 (nagios-plugins 1.4.15)
Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>
Copyright (c) 1999-2008 Nagios Plugin Development Team
        <nagiosplug-devel@lists.sourceforge.net>

This plugin checks the amount of used disk space on a mounted file system
and generates an alert if free space is less than one of the threshold values


Usage:
check_disk -w limit -c limit [-W limit] [-K limit] {-p path | -x device}
[-C] [-E] [-e] [-g group ] [-k] [-l] [-M] [-m] [-R path ] [-r path ]
[-t timeout] [-u unit] [-v] [-X type]

Options:
-h, --help
    Print detailed help screen
-V, --version
    Print version information
-w, --warning=INTEGER
    Exit with WARNING status if less than INTEGER units of disk are free
-w, --warning=PERCENT%
    Exit with WARNING status if less than PERCENT of disk space is free
-c, --critical=INTEGER
    Exit with CRITICAL status if less than INTEGER units of disk are free
-c, --critical=PERCENT%
    Exit with CRITCAL status if less than PERCENT of disk space is free
-W, --iwarning=PERCENT%
    Exit with WARNING status if less than PERCENT of inode space is free
-K, --icritical=PERCENT%
    Exit with CRITICAL status if less than PERCENT of inode space is free
-p, --path=PATH, --partition=PARTITION
    Path or partition (may be repeated)
-x, --exclude_device=PATH <STRING>
    Ignore device (only works if -p unspecified)
-C, --clear
    Clear thresholds
-E, --exact-match
    For paths or partitions specified with -p, only check for exact paths
-e, --errors-only
    Display only devices/mountpoints with errors
-g, --group=NAME
    Group paths. Thresholds apply to (free-)space of all partitions together
-k, --kilobytes
    Same as '--units kB'
-l, --local
    Only check local filesystems
-L, --stat-remote-fs
    Only check local filesystems against thresholds. Yet call stat on remote filesystems
    to test if they are accessible (e.g. to detect Stale NFS Handles)
-M, --mountpoint
    Display the mountpoint instead of the partition
-m, --megabytes
    Same as '--units MB'
-A, --all
    Explicitly select all paths. This is equivalent to -R '.*'
-R, --eregi-path=PATH, --eregi-partition=PARTITION
    Case insensitive regular expression for path/partition (may be repeated)
-r, --ereg-path=PATH, --ereg-partition=PARTITION
    Regular expression for path or partition (may be repeated)
-I, --ignore-eregi-path=PATH, --ignore-eregi-partition=PARTITION
    Regular expression to ignore selected path/partition (case insensitive) (may be repeated)
-i, --ignore-ereg-path=PATH, --ignore-ereg-partition=PARTITION
    Regular expression to ignore selected path or partition (may be repeated)
-t, --timeout=INTEGER
    Seconds before connection times out (default: 10)
-u, --units=STRING
    Choose bytes, kB, MB, GB, TB (default: MB)
-v, --verbose
    Show details for command-line debugging (Nagios may truncate output)
-X, --exclude-type=TYPE
    Ignore all filesystems of indicated type (may be repeated)

Examples:
check_disk -w 10% -c 5% -p /tmp -p /var -C -w 100000 -c 50000 -p /
    Checks /tmp and /var at 10% and 5%, and / at 100MB and 50MB
check_disk -w 100 -c 50 -C -w 1000 -c 500 -g sidDATA -r '^/oracle/SID/data.*$'
    Checks all filesystems not matching -r at 100M and 50M. The fs matching the -r regex
    are grouped which means the freespace thresholds are applied to all disks together
check_disk -w 100 -c 50 -C -w 1000 -c 500 -p /foo -C -w 5% -c 3% -p /bar
    Checks /foo for 1000M/500M and /bar for 5/3%. All remaining volumes use 100M/50M

Send email to nagios-users@lists.sourceforge.net if you have questions
regarding use of this software. To submit patches or suggest improvements,
send email to nagiosplug-devel@lists.sourceforge.net



之后,监控OK



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-285319-1-1.html 上篇帖子: Nagios监控数据库DB2--check_db2_health 下篇帖子: nagios告警发不出问题解决 accessible
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表