Icinga / icinga2

The core of our monitoring platform with a powerful configuration language and REST API.
https://icinga.com/docs/icinga2/latest
GNU General Public License v2.0
2.03k stars 578 forks source link

DISK UNKNOWN: Paths need to be selected before using -i/-I. Use -A to select all paths explicitly #6783

Closed mrkafk closed 5 years ago

mrkafk commented 6 years ago

Expected Behavior

vars.disk_ignore_eregi_path ignores some path in disk_check.

Current Behavior

Plugin message:

DISK UNKNOWN: Paths need to be selected before using -i/-I. Use -A to select all paths explicitly

Possible Solution

Same message as in https://github.com/icinga/icinga2/issues/2890

I enabled debug log. Relevant section:

[2018-11-16 22:16:58 +0100] debug/HttpUtility: Request body: '{"next_check":1542403018,"force":true,"service":"titan.dom!disk"}'
[2018-11-16 22:16:58 +0100] notice/ApiActionHandler: Running action reschedule-check
[2018-11-16 22:16:58 +0100] notice/ApiListener: Relaying 'event::SetForceNextCheck' message
[2018-11-16 22:16:58 +0100] notice/ApiListener: Relaying 'event::SetNextCheck' message
[2018-11-16 22:16:58 +0100] debug/IdoPgsqlConnection: Query: UPDATE icinga_servicestatus SET next_check = TO_TIMESTAMP(1542403018) AT TIME ZONE 'UTC' WHERE service_object_id = 233
[2018-11-16 22:16:58 +0100] debug/CheckerComponent: Scheduling info for checkable 'titan.dom!disk' (2018-11-16 22:16:58 +0100): Object 'titan.dom!disk', Next Check: 2018-11-16 22:16:58 +0100(1.5424e+09).
[2018-11-16 22:16:58 +0100] debug/CheckerComponent: Executing check for 'titan.dom!disk'
[2018-11-16 22:16:58 +0100] notice/ApiListener: Relaying 'event::SetForceNextCheck' message
[2018-11-16 22:16:58 +0100] debug/Checkable: Update checkable 'titan.dom!disk' with check interval '60' from last check time at 2018-11-16 22:15:52 +0100 (1.5424e+09) to next check time at 2018-11-16 22:17:55 +0100(1.5424e+09).
[2018-11-16 22:16:58 +0100] notice/ApiListener: Relaying 'event::SetNextCheck' message
[2018-11-16 22:16:58 +0100] notice/Process: Running command '/usr/lib/nagios/plugins/check_disk' '-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' '-I' '/tmp/\.mount_Joplin.*': PID 72313
[2018-11-16 22:16:58 +0100] debug/CheckerComponent: Check finished for object 'titan.dom!disk'
[2018-11-16 22:16:58 +0100] notice/Process: PID 72313 ('/usr/lib/nagios/plugins/check_disk' '-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' '-I' '/tmp/\.mount_Joplin.*') terminated with exit code 3
[2018-11-16 22:16:58 +0100] debug/Checkable: Update checkable 'titan.dom!disk' with check interval '60' from last check time at 2018-11-16 22:16:58 +0100 (1.5424e+09) to next check time at 2018-11-16 22:17:55 +0100(1.5424e+09).
[2018-11-16 22:16:58 +0100] debug/DbEvents: add checkable check history for 'titan.dom!disk'
[2018-11-16 22:16:58 +0100] notice/ApiListener: Relaying 'event::SetNextCheck' message
[2018-11-16 22:16:58 +0100] notice/ApiListener: Relaying 'event::CheckResult' message
[2018-11-16 22:16:58 +0100] debug/IdoPgsqlConnection: Query: UPDATE icinga_servicestatus SET acknowledgement_type = E'0',  active_checks_enabled = E'1',  check_command = E'disk',  check_source = E'titan.dom',  check_type = E'0',  current_check_attempt = E'1',  current_notification_number = E'40',  current_state = E'3',  endpoint_object_id = 217,  event_handler_enabled = E'1',  execution_time = E'0.002879',  flap_detection_enabled = E'0',  has_been_checked = E'1',  instance_id = 1,  is_flapping = E'0',  is_reachable = E'1',  last_check = TO_TIMESTAMP(1542403018) AT TIME ZONE 'UTC',  last_hard_state = E'3',  last_hard_state_change = TO_TIMESTAMP(1542402035) AT TIME ZONE 'UTC',  last_notification = TO_TIMESTAMP(1542402035) AT TIME ZONE 'UTC',  last_state_change = TO_TIMESTAMP(1542402035) AT TIME ZONE 'UTC',  last_time_critical = TO_TIMESTAMP(1542401983) AT TIME ZONE 'UTC',  last_time_ok = TO_TIMESTAMP(1542295529) AT TIME ZONE 'UTC',  last_time_unknown = TO_TIMESTAMP(1542403018) AT TIME ZONE 'UTC',  latency = E'0.536110',  long_output = E'',  max_check_attempts = E'5',  next_check = TO_TIMESTAMP(1542403075) AT TIME ZONE 'UTC',  next_notification = TO_TIMESTAMP(1542403835) AT TIME ZONE 'UTC',  normal_check_interval = E'1',  notifications_enabled = E'1',  original_attributes = E'null',  output = E'DISK UNKNOWN: Paths need to be selected before using -i/-I. Use -A to select all paths explicitly',  passive_checks_enabled = E'1',  percent_state_change = E'4.200000',  perfdata = E'',  problem_has_been_acknowledged = E'0',  process_performance_data = E'1',  retry_check_interval = E'0.500000',  scheduled_downtime_depth = E'0',  service_object_id = 233,  should_be_scheduled = E'1',  state_type = E'1',  status_update_time = TO_TIMESTAMP(1542403018) AT TIME ZONE 'UTC' WHERE service_object_id = 233

Steps to Reproduce (for bugs)

  1. In host section configure:
vars.disk_ignore_eregi_path = [ "/tmp/\\.mount_Joplin.*" ]

Context

Your Environment

2.10.2-1.stretch

icinga2 - The Icinga 2 network monitoring daemon (version: r2.10.2-1)

Copyright (c) 2012-2018 Icinga Development Team (https://icinga.com/)
License GPLv2+: GNU GPL version 2 or later <http://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: Debian GNU/Linux
  Platform version: 9 (stretch)
  Kernel: Linux
  Kernel version: 4.9.0-8-amd64
  Architecture: x86_64

Build information:
  Compiler: GNU 6.3.0
  Build host: 486e413fb159

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

Disabled features: command compatlog debuglog elasticsearch gelf graphite influxdb livestatus opentsdb perfdata statusdata syslog Enabled features: api checker ido-pgsql mainlog notification

2.6.1

[2018-11-16 22:12:09 +0100] information/cli: Icinga application loader (version: r2.10.2-1)
[2018-11-16 22:12:09 +0100] information/cli: Loading configuration file(s).
[2018-11-16 22:12:09 +0100] information/ConfigItem: Committing config item(s).
[2018-11-16 22:12:09 +0100] information/ApiListener: My API identity: titan.dom
[2018-11-16 22:12:09 +0100] information/ConfigItem: Instantiated 1 ScheduledDowntime.
[2018-11-16 22:12:09 +0100] information/ConfigItem: Instantiated 14 Services.
[2018-11-16 22:12:09 +0100] information/ConfigItem: Instantiated 1 IcingaApplication.
[2018-11-16 22:12:09 +0100] information/ConfigItem: Instantiated 2 Hosts.
[2018-11-16 22:12:09 +0100] information/ConfigItem: Instantiated 1 FileLogger.
[2018-11-16 22:12:09 +0100] information/ConfigItem: Instantiated 2 NotificationCommands.
[2018-11-16 22:12:09 +0100] information/ConfigItem: Instantiated 12 Notifications.
[2018-11-16 22:12:09 +0100] information/ConfigItem: Instantiated 1 NotificationComponent.
[2018-11-16 22:12:09 +0100] information/ConfigItem: Instantiated 2 HostGroups.
[2018-11-16 22:12:09 +0100] information/ConfigItem: Instantiated 1 ApiListener.
[2018-11-16 22:12:09 +0100] information/ConfigItem: Instantiated 1 Downtime.
[2018-11-16 22:12:09 +0100] information/ConfigItem: Instantiated 1 CheckerComponent.
[2018-11-16 22:12:09 +0100] information/ConfigItem: Instantiated 3 Zones.
[2018-11-16 22:12:09 +0100] information/ConfigItem: Instantiated 1 Endpoint.
[2018-11-16 22:12:09 +0100] information/ConfigItem: Instantiated 1 ApiUser.
[2018-11-16 22:12:09 +0100] information/ConfigItem: Instantiated 1 User.
[2018-11-16 22:12:09 +0100] information/ConfigItem: Instantiated 215 CheckCommands.
[2018-11-16 22:12:09 +0100] information/ConfigItem: Instantiated 1 IdoPgsqlConnection.
[2018-11-16 22:12:09 +0100] information/ConfigItem: Instantiated 1 UserGroup.
[2018-11-16 22:12:09 +0100] information/ConfigItem: Instantiated 3 ServiceGroups.
[2018-11-16 22:12:09 +0100] information/ConfigItem: Instantiated 3 TimePeriods.
[2018-11-16 22:12:09 +0100] information/ScriptGlobal: Dumping variables to file '/var/cache/icinga2/icinga2.vars'
[2018-11-16 22:12:09 +0100] information/cli: Finished validating the configuration file(s).
mrkafk commented 6 years ago

I found a workaround: if I do NOT specify vars.disk_ignore_ereg_path as an array, instead using a single string, it works as expected:

vars.disk_ignore_ereg_path =  "/tmp/\\.mount*"
Marci24h commented 5 years ago

Hi,

I'm note sure if that's an issue? If i specify the Path with '-r' or '-R' as mentiond in the Error Message, it works. Repeating -i/-I is also possible. Specifying the Array at the Host Object also works fine. (also in director)

Have you tried to add the root Path "/" with -r/-R?

e.g. '/usr/lib/nagios/plugins/check_disk' '-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' '-R' '/' -I '^\/mnt\/cifs\/.*' -I '^\/mnt\/nfs\/.*'

object Host "host.example.com" {
    import "client-linux"

    display_name = "hostname"
    address = "10.1.2.3"
    vars.disk_ereg_path = [ "/" ]
    vars.disk_ignore_eregi_path = [ "^\\/mnt\\/cifs\\/.*", "^\\/mnt\\/nfs\\/.*" ]
}

Versions: _/usr/lib/nagios/plugins/check_disk -V checkdisk v2.2 (monitoring-plugins 2.2) icinga2 - version: r2.10.2-1

lippserd commented 5 years ago

Looks like it's working. I close this one.