{"action":"closed","issue":{"url":"https://api.github.com/repos/mickem/nscp/issues/158","labels_url":"https://api.github.com/repos/mickem/nscp/issues/158/labels{/name}","comments_url":"https://api.github.com/repos/mickem/nscp/issues/158/comments","events_url":"https://api.github.com/repos/mickem/nscp/issues/158/events","html_url":"https://github.com/mickem/nscp/issues/158","id":86170711,"number":158,"title":"0.4.3.131 ( nscp nrpe / check_nrpe ) Argument parsing changed compared to legacy check_nrpe","user":{"login":"m-kraus","id":3293494,"avatar_url":"https://avatars.githubusercontent.com/u/3293494?v=3","gravatar_id":"","url":"https://api.github.com/users/m-kraus","html_url":"https://github.com/m-kraus","followers_url":"https://api.github.com/users/m-kraus/followers","following_url":"https://api.github.com/users/m-kraus/following{/other_user}","gists_url":"https://api.github.com/users/m-kraus/gists{/gist_id}","starred_url":"https://api.github.com/users/m-kraus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m-kraus/subscriptions","organizations_url":"https://api.github.com/users/m-kraus/orgs","repos_url":"https://api.github.com/users/m-kraus/repos","events_url":"https://api.github.com/users/m-kraus/events{/privacy}","received_events_url":"https://api.github.com/users/m-kraus/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mickem/nscp/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"mickem","id":1434697,"avatar_url":"https://avatars.githubusercontent.com/u/1434697?v=3","gravatar_id":"","url":"https://api.github.com/users/mickem","html_url":"https://github.com/mickem","followers_url":"https://api.github.com/users/mickem/followers","following_url":"https://api.github.com/users/mickem/following{/other_user}","gists_url":"https://api.github.com/users/mickem/gists{/gist_id}","starred_url":"https://api.github.com/users/mickem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mickem/subscriptions","organizations_url":"https://api.github.com/users/mickem/orgs","repos_url":"https://api.github.com/users/mickem/repos","events_url":"https://api.github.com/users/mickem/events{/privacy}","received_events_url":"https://api.github.com/users/mickem/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/mickem/nscp/milestones/3","html_url":"https://github.com/mickem/nscp/milestones/0.4.4","labels_url":"https://api.github.com/repos/mickem/nscp/milestones/3/labels","id":945790,"number":3,"title":"0.4.4","description":"* rest client\r\n* revised API\r\n* collectd support","creator":{"login":"mickem","id":1434697,"avatar_url":"https://avatars.githubusercontent.com/u/1434697?v=3","gravatar_id":"","url":"https://api.github.com/users/mickem","html_url":"https://github.com/mickem","followers_url":"https://api.github.com/users/mickem/followers","following_url":"https://api.github.com/users/mickem/following{/other_user}","gists_url":"https://api.github.com/users/mickem/gists{/gist_id}","starred_url":"https://api.github.com/users/mickem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mickem/subscriptions","organizations_url":"https://api.github.com/users/mickem/orgs","repos_url":"https://api.github.com/users/mickem/repos","events_url":"https://api.github.com/users/mickem/events{/privacy}","received_events_url":"https://api.github.com/users/mickem/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":10,"state":"open","created_at":"2015-01-21T19:41:29Z","updated_at":"2015-11-20T16:36:13Z","due_on":"2015-06-29T22:00:00Z","closed_at":null},"comments":1,"created_at":"2015-06-08T13:10:19Z","updated_at":"2015-11-20T16:36:13Z","closed_at":"2015-11-20T16:36:13Z","body":"I am currently starting to migrate an huge setup from legacy nrpe with nsclient 0.3.9 to nscp nrpe with nsclient 0.4.3 and ran into some issues regarding argument parsing:\r\n\r\nMy test setup consists of an NSClient-0.4.3.131-Server running on Windows7 and check_nrpe running on Centos7, each installed from your official msi/rpm packages.\r\n\r\nRunning **legacy check_nrpe** from an recent OMD install against the NSClient-Server in insecure mode seems to work as in earlier releases:\r\n```\r\n/omd/versions/default/lib/nagios/plugins/check_nrpe -H 10.0.2.2 -p 5666 \\\r\n-c check_cpu \\\r\n-a \"warn=load>88\" \"crit=load>99\" \"time=20m\"\r\nOK: CPU load is ok.|'total 20m'=0%;88;99\r\n```\r\n\r\nWhen trying to run the same command with your more secure **check_nrpe** or **nscp nrpe** it seems, that only the first arguemnt is taken into account:\r\n```\r\n/bin/check_nrpe --host 10.0.2.2 --port 5666 \\\r\n--ca /vagrant/nscp_certs/myca.pem \\\r\n--certificate /vagrant/nscp_certs/mycert.pem \\\r\n--certificate-key /vagrant/nscp_certs/mycert_key.pem \\\r\n--verify peer-cert  \\\r\n--ssl \\\r\n--command check_cpu \\\r\n--arguments \"warn=load>88\" \"crit=load>99\" \"time=20m\"                                                                                 \r\nOK: CPU load is ok.|'total 5m'=0%;88;90 'total 1m'=0%;88;90 'total 5s'=0%;88;90\r\n```\r\n\r\nOnly when suppliying multiple **--arguments** the command shows the same behaviour as the legacy check_nrpe:\r\n```\r\n /bin/check_nrpe --host 10.0.2.2 --port 5666 \\\r\n...\r\n--command check_cpu \\\r\n--arguments \"warn=load>88\" \\\r\n--arguments \"crit=load>99\" \\\r\n--arguments \"time=20m\"\r\nOK: CPU load is ok.|'total 20m'=0%;88;99\r\n```\r\n\r\nTrying other escaping options result in error messages:\r\n```\r\n /bin/check_nrpe --host 10.0.2.2 --port 5666 \\\r\n...\r\n--command check_cpu \\\r\n--arguments '\"warn=load>88\" \"crit=load>99\" \"time=20m\"'\r\nInvalid command line: unrecognised option '\"warn=load>88\" \"crit=load>99\" \"time=20m\"'\r\n```\r\n\r\n```\r\n /bin/check_nrpe --host 10.0.2.2 --port 5666 \\\r\n...\r\n--command check_cpu \\\r\n--arguments \"warn=load>88 crit=load>99 time=20m\"\r\nFailed to validate filter see log for details\r\nD  w32system Parsing failed of 'load>88 crit=load>99 time=20m' at: crit=load>99 time=20m\r\n```\r\n\r\nIs this behaviour of **check_nrpe** / **nscp nrpe** intended or am i missing something? Hopefully not, because otherwise i would have to make huge changes in my configuration generator logic :smiley: \r\n"}}