{"action":"created","issue":{"url":"https://api.github.com/repos/Icinga/icinga2/issues/6248","repository_url":"https://api.github.com/repos/Icinga/icinga2","labels_url":"https://api.github.com/repos/Icinga/icinga2/issues/6248/labels{/name}","comments_url":"https://api.github.com/repos/Icinga/icinga2/issues/6248/comments","events_url":"https://api.github.com/repos/Icinga/icinga2/issues/6248/events","html_url":"https://github.com/Icinga/icinga2/issues/6248","id":316194076,"number":6248,"title":"ITL command check_swap","user":{"login":"xtruthx","id":2736347,"avatar_url":"https://avatars2.githubusercontent.com/u/2736347?v=4","gravatar_id":"","url":"https://api.github.com/users/xtruthx","html_url":"https://github.com/xtruthx","followers_url":"https://api.github.com/users/xtruthx/followers","following_url":"https://api.github.com/users/xtruthx/following{/other_user}","gists_url":"https://api.github.com/users/xtruthx/gists{/gist_id}","starred_url":"https://api.github.com/users/xtruthx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xtruthx/subscriptions","organizations_url":"https://api.github.com/users/xtruthx/orgs","repos_url":"https://api.github.com/users/xtruthx/repos","events_url":"https://api.github.com/users/xtruthx/events{/privacy}","received_events_url":"https://api.github.com/users/xtruthx/received_events","type":"User","site_admin":false},"labels":[{"id":520054013,"url":"https://api.github.com/repos/Icinga/icinga2/labels/ITL","name":"ITL","color":"9FF781","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-04-20T09:26:06Z","updated_at":"2018-04-20T12:45:14Z","closed_at":null,"author_association":"NONE","body":"We should remove the command option \"-n\" from  the check_swap cause it did not exist any longer or actual.\r\n\r\n#### itl-command:\r\n\r\n> \r\n\r\nobject CheckCommand \"swap\" {\r\n    import \"plugin-check-command\"\r\n    command = [ PluginDir + \"/check_swap\" ]\r\n    timeout = 1m\r\n    arguments += {\r\n        \"-a\" = {\r\n            description = \"Conduct comparisons for all swap partitions, one by one\"\r\n            set_if = \"$swap_allswaps$\"\r\n        }\r\n        \"-c\" = {{\r\n            /* Unable to fetch function body through API */\r\n        }}\r\n        \"-n\" = {\r\n            description = \"Resulting state when there is no swap regardless of thresholds. Possible values are \\\"ok\\\", \\\"warning\\\", \\\"critical\\\", \\\"unknown\\\". Defaults to \\\"critical\\\"\"\r\n            value = \"$swap_noswap$\"\r\n        }\r\n        \"-w\" = {{\r\n            /* Unable to fetch function body through API */\r\n        }}\r\n    }\r\n    vars.swap_allswaps = false\r\n    vars.swap_cfree = 25\r\n    vars.swap_integer = false\r\n    vars.swap_wfree = 50\r\n}\r\n\r\n\r\n#### Affected file:\r\n`\r\n[root@localhost~]# less /usr/share/icinga2/include/command-plugins.conf\r\n`\r\n#### check output:\r\n`\r\n/usr/lib64/nagios/plugins/check_swap: invalid option -- 'n'\r\nUsage:\r\n check_swap [-av] -w <percent_free>% -c <percent_free>%\r\n  -w <bytes_free> -c <bytes_free>\r\n`\r\n\r\n>\r\n[root@localhost~]# /usr/lib64/nagios/plugins/check_swap --help\r\ncheck_swap v2.2.1 (nagios-plugins 2.2.1)\r\nCopyright (c) 2000-2014 Nagios Plugin Development Team\r\n        <devel@nagios-plugins.org>\r\n\r\nCheck swap space on local machine.\r\n\r\nUsage:\r\n check_swap [-av] -w <percent_free>% -c <percent_free>%\r\n  -w <bytes_free> -c <bytes_free>\r\n\r\nOptions:\r\n -h, --help\r\n    Print detailed help screen\r\n -V, --version\r\n    Print version information\r\n --extra-opts=[section][@file]\r\n    Read options from an ini file. See\r\n    https://www.nagios-plugins.org/doc/extra-opts.html\r\n    for usage and examples.\r\n -w, --warning=INTEGER\r\n    Exit with WARNING status if less than INTEGER bytes of swap space are free\r\n -w, --warning=PERCENT%%\r\n    Exit with WARNING status if less than PERCENT of swap space is free\r\n -c, --critical=INTEGER\r\n    Exit with CRITICAL status if less than INTEGER bytes of swap space are free\r\n -c, --critical=PERCENT%%\r\n    Exit with CRITICAL status if less than PERCENT of swap space is free\r\n -a, --allswaps\r\n    Conduct comparisons for all swap partitions, one by one\r\n -v, --verbose\r\n    Show details for command-line debugging (Nagios may truncate output)\r\n\r\nNotes:\r\n Both INTEGER and PERCENT thresholds can be specified, they are all checked.\r\n On AIX, if -a is specified, uses lsps -a, otherwise uses lsps -s.\r\n\r\nSend email to help@nagios-plugins.org if you have questions regarding use\r\nof this software. To submit patches or suggest improvements, send email to\r\ndevel@nagios-plugins.org\r\n\r\n>\r\n#### OS:\r\nNAME=\"Red Hat Enterprise Linux Server\"\r\nVERSION=\"7.4 (Maipo)\"\r\nID=\"rhel\"\r\nID_LIKE=\"fedora\"\r\nVARIANT=\"Server\"\r\nVARIANT_ID=\"server\"\r\nVERSION_ID=\"7.4\"\r\nPRETTY_NAME=\"Red Hat Enterprise Linux Server 7.4 (Maipo)\"\r\nANSI_COLOR=\"0;31\"\r\nCPE_NAME=\"cpe:/o:redhat:enterprise_linux:7.4:GA:server\"\r\nHOME_URL=\"https://www.redhat.com/\"\r\nBUG_REPORT_URL=\"https://bugzilla.redhat.com/\"\r\n\r\nREDHAT_BUGZILLA_PRODUCT=\"Red Hat Enterprise Linux 7\"\r\nREDHAT_BUGZILLA_PRODUCT_VERSION=7.4\r\nREDHAT_SUPPORT_PRODUCT=\"Red Hat Enterprise Linux\"\r\nREDHAT_SUPPORT_PRODUCT_VERSION=\"7.4\"\r\nRed Hat Enterprise Linux Server release 7.4 (Maipo)\r\nRed Hat Enterprise Linux Server release 7.4 (Maipo)\r\ncpe:/o:redhat:enterprise_linux:7.4:ga:server\r\n\r\n#### Icinga 2 Version:\r\nicinga2 - The Icinga 2 network monitoring daemon (version: r2.8.2-1)\r\n\r\nCopyright (c) 2012-2017 Icinga Development Team (https://www.icinga.com/)\r\nLicense GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl2.html>\r\nThis is free software: you are free to change and redistribute it.\r\nThere is NO WARRANTY, to the extent permitted by law.\r\n\r\nApplication information:\r\n  Installation root: /usr\r\n  Sysconf directory: /etc\r\n  Run directory: /run\r\n  Local state directory: /var\r\n  Package data directory: /usr/share/icinga2\r\n  State path: /var/lib/icinga2/icinga2.state\r\n  Modified attributes path: /var/lib/icinga2/modified-attributes.conf\r\n  Objects path: /var/cache/icinga2/icinga2.debug\r\n  Vars path: /var/cache/icinga2/icinga2.vars\r\n  PID path: /run/icinga2/icinga2.pid\r\n\r\nSystem information:\r\n  Platform: Red Hat Enterprise Linux Server\r\n  Platform version: 7.4 (Maipo)\r\n  Kernel: Linux\r\n  Kernel version: 3.10.0-693.1.1.el7.x86_64\r\n  Architecture: x86_64\r\n\r\nBuild information:\r\n  Compiler: GNU 4.8.5\r\n  Build host: unknown\r\n\r\nIt seems that there is in the project a open merge request for it https://github.com/nagios-plugins/nagios-plugins/pull/369.\r\n\r\nAnd may someone can tell me why it did not format the issue in the right beahviour?\r\n\r\nCheers"},"comment":{"url":"https://api.github.com/repos/Icinga/icinga2/issues/comments/383084290","html_url":"https://github.com/Icinga/icinga2/issues/6248#issuecomment-383084290","issue_url":"https://api.github.com/repos/Icinga/icinga2/issues/6248","id":383084290,"user":{"login":"mcktr","id":18580278,"avatar_url":"https://avatars2.githubusercontent.com/u/18580278?v=4","gravatar_id":"","url":"https://api.github.com/users/mcktr","html_url":"https://github.com/mcktr","followers_url":"https://api.github.com/users/mcktr/followers","following_url":"https://api.github.com/users/mcktr/following{/other_user}","gists_url":"https://api.github.com/users/mcktr/gists{/gist_id}","starred_url":"https://api.github.com/users/mcktr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcktr/subscriptions","organizations_url":"https://api.github.com/users/mcktr/orgs","repos_url":"https://api.github.com/users/mcktr/repos","events_url":"https://api.github.com/users/mcktr/events{/privacy}","received_events_url":"https://api.github.com/users/mcktr/received_events","type":"User","site_admin":false},"created_at":"2018-04-20T12:45:14Z","updated_at":"2018-04-20T12:45:14Z","author_association":"MEMBER","body":"You are comparing monitoring-plugins and nagios-plugins, this are two different things.\r\n\r\nThe check_swap plugin from monitoring-plugins supports the `-n` attribute as you can see here: https://www.monitoring-plugins.org/doc/man/check_swap.html. But the check_swap plugin from nagios-plugins do not support the `-n` support: http://nagios-plugins.org/doc/man/check_swap.html\r\n\r\nSince we are mention the monitoring-plugins in the documentation I would stay with that version, but I don't know if all Linux distributions have the monitoring-plugins in their repositories, so it may makes sense to drop the parameter `-n` to support both versions. "}}
{"actor":{"display_login":"mcktr"}}