# Check\_command disk

**URL:** <https://community.icinga.com/t/check-command-disk/3905>\
**Category:** Icinga 2\
**Created:** [March 27, 2020, 10:05am UTC](https://community.icinga.com/t/check-command-disk/3905 "2020-03-27T10:05:02Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julien](https://community.icinga.com/letter_avatar_proxy/v4/letter/j/71e660/32.png) [@Julien](https://community.icinga.com/u/Julien)\
**Post date:** [March 27, 2020, 10:05am UTC](https://community.icinga.com/t/check-command-disk/3905/1 "2020-03-27T10:05:02Z")

</div>

Hello,

Since few days, I have a problem with this check command.  
I receive wrong alert from Icinga2 at different hours in the day.  
Alert is going to warning, crtical, ok, and it start again.

If I check with ssh on the server, all is fine for the disk.

There’s no error in Icinga2’s log.

I find a an old bug which advise to add that in /usr/share/icinga2/include/command-plugins.conf  
vars.disk\_wfree = “15%” vars.disk\_cfree = “10%” vars.disk\_inode\_wfree = “15%” vars.disk\_inode\_cfree = “10%” vars.disk\_megabytes = true vars.disk\_exclude\_type = [ “none”, “tmpfs”, “sysfs”, “proc”, “configfs”, “devtmpfs”, “devfs”, “mtmfs”, “tracefs”, “cgroup”, “fuse.gvfsd-fuse”, “fuse.gvfs-fuse-daemon”, “fdescfs”, “overlay”, “nsfs”,

but nothing change.

Icinga2 is on a Debian GNU/Linux 9.12 (stretch)  
icinga2 - The Icinga 2 network monitoring daemon (version: r2.11.3-1)

if someone has a lead to check my configuration, I’m interested.

---

<div class="post-metadata">

**Author:** ![winem](https://community.icinga.com/user_avatar/community.icinga.com/winem/32/1201_2.png) [@winem](https://community.icinga.com/u/winem)\
**Post date:** [March 27, 2020, 4:30pm UTC](https://community.icinga.com/t/check-command-disk/3905/2 "2020-03-27T16:30:44Z")

</div>

Hi,

some more informations would be helpful. What does critical exactly mean? A plugin error? Does it report a full disk or partition? Is it always the same disk/partition that’s affected? Is it a local disk or some NFS for example?

This would be useful to help.

Cheers,  
Marcel

---

<div class="post-metadata">

**Author:** ![blakehartshorn](https://community.icinga.com/user_avatar/community.icinga.com/blakehartshorn/32/599_2.png) [@blakehartshorn](https://community.icinga.com/u/blakehartshorn)\
**Post date:** [March 27, 2020, 5:56pm UTC](https://community.icinga.com/t/check-command-disk/3905/3 "2020-03-27T17:56:37Z")

</div>

Additionally, if you can go to the check in Icingaweb, click “history” at the top and screenshot a chunk of that, we can see the status changes.

---

<div class="post-metadata">

**Author:** ![Julien](https://community.icinga.com/letter_avatar_proxy/v4/letter/j/71e660/32.png) [@Julien](https://community.icinga.com/u/Julien)\
**Post date:** [March 31, 2020, 12:38pm UTC](https://community.icinga.com/t/check-command-disk/3905/4 "2020-03-31T12:38:00Z")

</div>

Hi Marcel and Blake,

I found the problem, it was the disk’s server which was full.  
I move the /var/spool/icinga2/perfdata and /var/spool/icinga2/tmp to another disk and create symbolic link.

But I think I missed something in the definition of disk service.  
All my Linux’s servers have the disk of Icinga2’s server.

> //Disque Linux  
> apply Service “disquelinux” {  
> display\_name = “Disque”  
> import “generic-service”
> 
> check\_command = “disk”
> 
> ```
> vars.disk_wfree = "15%"
> vars.disk_cfree = "10%"
> vars.disk_inode_wfree = "15%"
> vars.disk_inode_cfree = "10%"
> vars.disk_megabytes = true
> vars.disk_exclude_type = [
> "none",
> "tmpfs",
> "sysfs",
> "proc",
> "configfs",
> "devtmpfs",
> "devfs",
> "mtmfs",
> "tracefs",
> "cgroup",
> "fuse.gvfsd-fuse",
> "fuse.gvfs-fuse-daemon",
> "fdescfs",
> "overlay",
> "nsfs",
> "squashfs"
> ]
> 
> ```
> 
> assign where host.address && host.vars.os == “Linux”  
> }

Best regards

---

<div class="post-metadata">

**Author:** ![Moustapha](https://community.icinga.com/letter_avatar_proxy/v4/letter/m/c2a13f/32.png) [@Moustapha](https://community.icinga.com/u/Moustapha)\
**Post date:** [October 9, 2020, 12:56pm UTC](https://community.icinga.com/t/check-command-disk/3905/5 "2020-10-09T12:56:37Z")

</div>

Hello,

I’m concern to this issue(look at the above messages), i have to choose vars.disk\_megabytes but i want something in gigabytes or terabytes.

As mentioned, the file /usr/share/icinga2/include/command-plugins.conf|grep disk is formatted to choose megabytes.

By the way, i specified that i need that method for another purpose (be able to choose partitions i need).

Best regards,  
Moustapha Kourouma

---

<div class="post-metadata">

**Author:** ![Al2Klimov](https://community.icinga.com/user_avatar/community.icinga.com/al2klimov/32/959_2.png) [@Al2Klimov](https://community.icinga.com/u/Al2Klimov)\
**Post date:** [October 12, 2020, 9:47am UTC](https://community.icinga.com/t/check-command-disk/3905/6 "2020-10-12T09:47:37Z")

</div>

Hello @Julien!

In your service apply rule I don’t see a `command_endpoint` attribute. However a such is required to pin checks to specific endpoints. And especially `check_disk` has to run on the host you’d like to check.

Are you sure it always actually runs on the desired host?

Best,  
AK

---

<div class="post-metadata">

**Author:** ![venkog](https://community.icinga.com/letter_avatar_proxy/v4/letter/v/a4c791/32.png) [@venkog](https://community.icinga.com/u/venkog)\
**Post date:** [October 18, 2023, 5:34pm UTC](https://community.icinga.com/t/check-command-disk/3905/7 "2023-10-18T17:34:10Z")

</div>

I have setup Icinga host , no Director yet. Added few hosts for Agent-based Monitoring [Step 2 – Setting up Agent-based Monitoring] following this [How To Monitor Hosts and Services with Icinga on Ubuntu 16.04 | DigitalOcean](https://www.digitalocean.com/community/tutorials/how-to-monitor-hosts-and-services-with-icinga-on-ubuntu-16-04)

I added disk check but having issues . Here is the check :  
apply Service “disk” {  
import “generic-service”  
check\_command = “disk”  
// vars.disk\_all = true  
vars.disk\_exclude\_type = [  
“none”,  
“tmpfs”,  
“sysfs”,  
“proc”,  
“configfs”,  
“devtmpfs”,  
“devfs”,  
“mtmfs”,  
“tracefs”,  
“cgroup”,  
“fuse.gvfsd-fuse”,  
“fuse.gvfs-fuse-daemon”,  
“fdescfs”,  
“overlay”,  
“nsfs”,  
“squashfs”  
]  
vars.disk\_ereg\_path = [“/”]  
vars.disk\_ignore\_ereg\_path = [“/run\*”,“/var/snap\*”, “/run/user/1000/doc”]  
command\_endpoint = host.vars.client\_endpoint  
assign where host.vars.client\_endpoint  
}  
The issues is it will trow error for example  
DISK CRITICAL - /run/user/1000/doc is not accessible: Permission denied  
Every other check. One check is fine , next time it checks it trows this error. Not sure why it will behave like that and not always return the correct result. Am I doing something wrong?

BTW as user nagios everything is ok , just somehow it doesn’t exclude unnecessary filesystems :  
nagios@workstation-01:/root$ /usr/lib/nagios/plugins/check\_disk -w 80 -c 90 -A -i ‘/run\*’ -i “/snap\*” -X tmpfs -X devtmpfs -X devpts -X hugetlbfs  
DISK OK - free space: / 42933 MB (72% inode=94%); /boot/efi 98 MB (94% inode=-);

On the workstation host I see on debug.log the command is executed differently every time :  
‘-c’ ‘10%’ ‘-w’ ‘20%’ ‘-X’ ‘none’ ‘-X’ ‘tmpfs’ ‘-X’ ‘sysfs’ ‘-X’ ‘proc’ ‘-X’ ‘configfs’ ‘-X’ ‘devtmpfs’ ‘-X’ ‘devfs’ ‘-X’ ‘mtmfs’ ‘-X’ ‘tracefs’ ‘-X’ ‘cgroup’ ‘-X’ ‘fuse.gvfsd-fuse’ ‘-X’ ‘fuse.gvfs-fuse-daemon’ ‘-X’ ‘fdescfs’ ‘-X’ ‘overlay’ ‘-X’ ‘nsfs’ ‘-X’ ‘squashfs’ ‘-m’) terminated with exit code 2

‘-c’ ‘10%’ ‘-w’ ‘20%’ ‘-X’ ‘none’ ‘-X’ ‘tmpfs’ ‘-X’ ‘sysfs’ ‘-X’ ‘proc’ ‘-X’ ‘configfs’ ‘-X’ ‘devtmpfs’ ‘-X’ ‘devfs’ ‘-X’ ‘mtmfs’ ‘-X’ ‘tracefs’ ‘-X’ ‘cgroup’ ‘-X’ ‘fuse.gvfsd-fuse’ ‘-X’ ‘fuse.gvfs-fuse-daemon’ ‘-X’ ‘fdescfs’ ‘-X’ ‘overlay’ ‘-X’ ‘nsfs’ ‘-X’ ‘squashfs’ ‘-m’ ‘-p’ ‘/’) terminated with exit code 0

When exit code is 0 there is ‘-p’ ‘/’ option , why is this difference? I only have declared disk once .

---

<div class="post-metadata">

**Author:** ![Al2Klimov](https://community.icinga.com/user_avatar/community.icinga.com/al2klimov/32/959_2.png) [@Al2Klimov](https://community.icinga.com/u/Al2Klimov)\
**Post date:** [October 19, 2023, 8:21am UTC](https://community.icinga.com/t/check-command-disk/3905/8 "2023-10-19T08:21:54Z")

</div>

Hello Venko!

We’re working on it:

> <https://github.com/Icinga/icinga2/issues/9033>
>
> \## Describe the bug
> In trying to exclude \`/run/user/0/doc\`, the GUI shows \`DISK… CRITICAL - /run/user/0/doc is not accessible: Permission denied\` even when \`tmpfs \`is being excluded. 
> 
> \## To Reproduce
> 
> Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. Include configuration, logs, etc. to reproduce, if relevant.
> Here is my config in \`hosts.conf\`:
> \`\`\`
> vars.disks\["disk /"\] = {
> disk\_partitions = "/"
> vars.disk\_ignore\_eregi\_path = \["/run" \]
> vars.disk\_exclude\_type = \["overlay","tmpfs","nsfs","sysfs","shm","debugfs","tracefs","nfs"\]
> vars.disk\_ignore\_ereg\_path = \["/run/0/doc"\]
> vars.disk\_partitions\_excluded = \["/run","/run/0/doc", "/run/user/0/doc"\]
> 
> }
> vars.disk\_exclude\_type = \[
> "tmpfs",
> "sysfs",
> "proc",
> "configfs",
> "devtmpfs",
> "devfs",
> "mtmfs",
> "tracefs",
> "cgroup",
> "fuse.gvfsd-fuse",
> "fuse.gvfs-fuse-daemon",
> "fdescfs",
> "overlay",
> "nsfs",
> "squashfs"
> \]
> check\_command = "hostalive"
> \`\`\`
> 
> \## Expected behavior
> 
> \`/run/user/0/doc\` should not be displayed.
> 
> \## Screenshots
> 
> !\[diskcritical\](https://user-images.githubusercontent.com/21204619/136992607-32989b1c-6d62-4322-826a-c23db06599f0.PNG)
> 
> \## Your Environment
> 
> Include as many relevant details about the environment you experienced the problem in
> 
> \* Version used (\`icinga2 --version\`): 
> \`\`\`
> icinga2 --version
> icinga2 - The Icinga 2 network monitoring daemon (version: 2.13.1-1)
> 
> Copyright (c) 2012-2021 Icinga GmbH (https://icinga.com/)
> License GPLv2+: GNU GPL version 2 or later \<https://gnu.org/licenses/gpl2.html\>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> 
> System information:
> Platform: Fedora
> Platform version: 34 (Server Edition)
> Kernel: Linux
> Kernel version: 5.13.19-200.fc34.x86\_64
> Architecture: x86\_64
> 
> Build information:
> Compiler: GNU 11.2.1
> Build host: unknown
> OpenSSL version: OpenSSL 1.1.1l FIPS 24 Aug 2021
> 
> Application information:
> 
> General paths:
> Config directory: /etc/icinga2
> Data directory: /var/lib/icinga2
> Log directory: /var/log/icinga2
> Cache directory: /var/cache/icinga2
> Spool directory: /var/spool/icinga2
> Run directory: /run/icinga2
> 
> Old paths (deprecated):
> Installation root: /usr
> Sysconf directory: /etc
> Run directory (base): /run
> Local state directory: /var
> 
> Internal paths:
> 
> Package data directory: /usr/share/icinga2
> State path: /var/lib/icinga2/icinga2.state
> Modified attributes path: /var/lib/icinga2/modified-attributes.conf
> Objects path: /var/cache/icinga2/icinga2.debug
> Vars path: /var/cache/icinga2/icinga2.vars
> PID path: /run/icinga2/icinga2.pid
> \`\`\`
> 
> \* Operating System and version: Fedora 34
> \* Enabled features (\`icinga2 feature list\`): Enabled features: api checker command ido-mysql mainlog notification syslog
> \* Icinga Web 2 version and modules (System - About): 2.9.3
> \* Config validation (\`icinga2 daemon -C\`):
> \`\`\`
> icinga2 daemon -C
> \[2021-10-12 12:16:44 -0400\] information/cli: Icinga application loader (version: 2.13.1-1)
> \[2021-10-12 12:16:44 -0400\] information/cli: Loading configuration file(s).
> \[2021-10-12 12:16:44 -0400\] information/ConfigItem: Committing config item(s).
> \[2021-10-12 12:16:44 -0400\] information/ApiListener: My API identity: mandelbrot.dsm.fordham.edu
> \[2021-10-12 12:16:44 -0400\] information/ConfigItem: Instantiated 1 IcingaApplication.
> \[2021-10-12 12:16:44 -0400\] information/ConfigItem: Instantiated 2 HostGroups.
> \[2021-10-12 12:16:44 -0400\] information/ConfigItem: Instantiated 5 Hosts.
> \[2021-10-12 12:16:44 -0400\] information/ConfigItem: Instantiated 2 NotificationCommands.
> \[2021-10-12 12:16:44 -0400\] information/ConfigItem: Instantiated 1 Downtime.
> \[2021-10-12 12:16:44 -0400\] information/ConfigItem: Instantiated 1 SyslogLogger.
> \[2021-10-12 12:16:44 -0400\] information/ConfigItem: Instantiated 5 Comments.
> \[2021-10-12 12:16:44 -0400\] information/ConfigItem: Instantiated 1 FileLogger.
> \[2021-10-12 12:16:44 -0400\] information/ConfigItem: Instantiated 1 CheckerComponent.
> \[2021-10-12 12:16:44 -0400\] information/ConfigItem: Instantiated 1 ApiListener.
> \[2021-10-12 12:16:44 -0400\] information/ConfigItem: Instantiated 1 IdoMysqlConnection.
> \[2021-10-12 12:16:44 -0400\] information/ConfigItem: Instantiated 3 Zones.
> \[2021-10-12 12:16:44 -0400\] information/ConfigItem: Instantiated 1 ExternalCommandListener.
> \[2021-10-12 12:16:44 -0400\] information/ConfigItem: Instantiated 1 Endpoint.
> \[2021-10-12 12:16:44 -0400\] information/ConfigItem: Instantiated 22 Notifications.
> \[2021-10-12 12:16:44 -0400\] information/ConfigItem: Instantiated 1 ApiUser.
> \[2021-10-12 12:16:44 -0400\] information/ConfigItem: Instantiated 244 CheckCommands.
> \[2021-10-12 12:16:44 -0400\] information/ConfigItem: Instantiated 1 NotificationComponent.
> \[2021-10-12 12:16:44 -0400\] information/ConfigItem: Instantiated 1 UserGroup.
> \[2021-10-12 12:16:44 -0400\] information/ConfigItem: Instantiated 1 User.
> \[2021-10-12 12:16:44 -0400\] information/ConfigItem: Instantiated 3 TimePeriods.
> \[2021-10-12 12:16:44 -0400\] information/ConfigItem: Instantiated 3 ServiceGroups.
> \[2021-10-12 12:16:44 -0400\] information/ConfigItem: Instantiated 1 ScheduledDowntime.
> \[2021-10-12 12:16:44 -0400\] information/ConfigItem: Instantiated 27 Services.
> \[2021-10-12 12:16:44 -0400\] information/ScriptGlobal: Dumping variables to file '/var/cache/icinga2/icinga2.vars'
> \[2021-10-12 12:16:44 -0400\] information/cli: Finished validating the configuration file(s).
> 
> \`\`\`
> 
> \## Additional context
> 
> I would think this is an issue with the Nagios plugin. Lower case, \`-x\` does work.

Best,  
A/K

---

<div class="post-metadata">

**Author:** ![venkog](https://community.icinga.com/letter_avatar_proxy/v4/letter/v/a4c791/32.png) [@venkog](https://community.icinga.com/u/venkog)\
**Post date:** [November 2, 2023, 5:16pm UTC](https://community.icinga.com/t/check-command-disk/3905/9 "2023-11-02T17:16:59Z")

</div>

Thanks, one would think it wont take years 🙂
