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

简介:
1
2
[root@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
[root@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




      本文转自YU文武貝 51CTO博客,原文链接:http://blog.51cto.com/linuxerxy/1861028,如需转载请自行联系原作者



相关文章
|
2天前
remount of the / superblock failed: Permission denied remount failed
remount of the / superblock failed: Permission denied remount failed
4 0
|
10月前
|
Oracle 关系型数据库 数据安全/隐私保护
you (oracle) are not allowed to access to crontab because of pam configuraion
you (oracle) are not allowed to access to crontab because of pam configuraion
196 0
|
Ruby
ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /usr/bin directory.错误解决办法
ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /usr/bin directory.错误解决办法
2500 0
|
关系型数据库 PostgreSQL Docker
docker:changing ownership of ‘.‘: Permission denied怎么办
docker:changing ownership of ‘.‘: Permission denied怎么办
408 0
docker:changing ownership of ‘.‘: Permission denied怎么办
|
Linux 数据安全/隐私保护
You (root) are not allowed to access to (crontab) because of pam configuration
巡检发现一台Linux服务器上的作业没有如期发送邮件,登录服务器检查后发现作业并没有执行,于是检查一下crontab的设置。结果发现如下错误:   [root@mylnx2 ~]# crontab -l   Authentication token is no longer valid; n...
2974 0
|
Unix Linux
Symantec Backup Exec 报"Access denied to directory xxx" Error Code E0008488
使用Symantec Backup Exec将几台Linux服务器上的RMAN备份收带时,偶尔会遇到作业备份失败的情况,检查Job History,就会发现有“Access denied to directory u05/backup/backupsets" 这类错误,当然实际路径为/u05/backup/backupsets.
2499 0
|
应用服务中间件 PHP
macOS mkdir: /usr/var: Operation not permitted
版权声明:本文为 testcs_dn(微wx笑) 原创文章,非商用自由转载-保持署名-注明出处,谢谢。 https://blog.csdn.net/testcs_dn/article/details/80016887 ...
2634 0