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

[[email protected] ~]# /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命令的话就会出现上述错误:

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

有些人会直接删除这个文件来确保自己监控的成功,但是我觉得这样是不合理的,总不能一言不合就把文件给删了吧。所以,我研究了下可以用下列命令来实现

command[check_disk]=/usr/local/nagios/libexec/check_disk -w 30% -c 20% -X nfs -X mvfs -A -i ‘.gvfs‘

忽略.gvfs,来看看check_disk的参数

[[email protected] ~]# /usr/local/nagios/libexec/check_disk --help                      
check_disk v1.4.15 (nagios-plugins 1.4.15)
Copyright (c) 1999 Ethan Galstad <[email protected]>
Copyright (c) 1999-2008 Nagios Plugin Development Team
        <[email protected]>

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 [email protected] if you have questions
regarding use of this software. To submit patches or suggest improvements,
send email to [email protected]

之后,监控OK

时间: 2024-08-08 04:09:53

nagios check_disk:DISK CRITICAL - /root/.gvfs is not accessible: Permission denied的相关文章

/run/user/1000/gvfs is not accessible Nagios监控问题

在Ubuntu14.04下安装nagios3.5.1, 且本机作为server端,/etc/init.d/nagios3 start之后,在web界面突然看到有一个红色警告,显示如下 DISK CRITIAL - /run/user/1000/gvfs is not accessible: Permission denied 然后去个naigos FAQ上找了下,竟然官方说这是一个bug,为bug#615848. 问题原因是FUSE文件系统和权限不配的问题,这里简要说下解决方法. 因为默认是自检

kvm install 报错could not open disk imageXXX: Permission denied

centos6.6挂载ntfs分区后,在ntfs分区上建立虚拟机: virt-install --name=centos6.5 --ram=1024 --vcpus=2 -f centos6.5.raw -s 20 -l /media/data/iso/CentOS-6.6-x86_64-bin-DVD1.iso 时报错: ERROR    internal error process exited while connecting to monitor: char device redirec

df: `/root/.gvfs&#39;: Permission denied

oracle用户使用df -h时报错 [[email protected] OraBackup]$ df -hdf: `/root/.gvfs': Permission deniedFilesystem      Size  Used Avail Use% Mounted on/dev/sda3        36G   14G   21G  40% /tmpfs           3.0G  1.2G  1.9G  40% /dev/shm/dev/sda1       194M   34M

`/root/.gvfs&#39;: Permission deniedcd

oracle用户使用df -h时报错  [[email protected] ~]$ df -h  Filesystem            Size  Used Avail Use% Mounted on /dev/mapper/VolGroup-LogVol02                        47G  4.8G   40G  11% / tmpfs                 127G  260K  127G   1% /dev/shm /dev/sda1       

salt-call报错OSError: [Errno 13] Permission denied: &#39;/root/.gvfs&#39;

今天通过salt获取磁盘信息,并且通过return到mysql,但是发现表里面少了点minion的信息,然后经查看,都是一些新的ibm x3650 m4的机器 然后在saltstack的源码找到了status.diskusage的实现,先看看是怎么实现的磁盘使用量吧,下面是源码 ret = {} for path in selected: fsstats = os.statvfs(path) blksz = fsstats.f_bsize available = fsstats.f_bavail

kylin cube测试时,报错:org.apache.hadoop.security.AccessControlException: Permission denied: user=root, access=WRITE, inode=&quot;/user&quot;:hdfs:supergroup:drwxr-xr-x

异常: org.apache.hadoop.security.AccessControlException: Permission denied: user=root, access=WRITE, inode="/user":hdfs:supergroup:drwxr-xr-x at org.apache.hadoop.hdfs.server.namenode.DefaultAuthorizationProvider.checkFsPermission(DefaultAuthoriza

nagios Permission denied: exec of &#39;/usr/local/nagios/sbin/status.cgi&#39; failed, referer:

nagios   出现nagios Permission denied类似的报错,具体报错我贴在下面,这样的原因就是selinux没关.关闭即可 1.临时关闭(不用重启机器): setenforce 0                  ##设置SELinux 成为permissive模式 ##setenforce 1 设置SELinux 成为enforcing模式 2.修改配置文件需要重启机器: 修改/etc/selinux/config 文件 将SELINUX=enforcing改为SELI

用root帐号切换其他帐号提示 su: warning: cannot change directory to /home/oracle: Permission denied

用root帐号切换其他帐号提示: 出错原因: 基本上是根目录或者是/home/oracle目录权限的问题 解决办法: 更改根目录权限为755,并保证对应用户主目录的所属用户和所属组一致和用户名一致. 示例: --本篇文章转自http://blog.csdn.net/jack161641/article/details/7090490 用root帐号切换其他帐号提示 su: warning: cannot change directory to /home/oracle: Permission d

解决Ubuntu的root账号无法登录SSH问题-Permission denied, please try again.

刚安装了Ubuntu 14.04 server的虚拟机,普通帐号可以远程登录,但是root不行,输入密码后一直报错: permission denied 最后发现ssh的配置(/etc/ssh/sshd_config)不大一样,14.04的默认配置是: PermitRootLogin without-password 改为: PermitRootLogin yes 然后重启ssh: restart ssh 再ssh localhost就可以登录了