{"action":"created","issue":{"url":"https://api.github.com/repos/centreon/centreon/issues/4508","repository_url":"https://api.github.com/repos/centreon/centreon","labels_url":"https://api.github.com/repos/centreon/centreon/issues/4508/labels{/name}","comments_url":"https://api.github.com/repos/centreon/centreon/issues/4508/comments","events_url":"https://api.github.com/repos/centreon/centreon/issues/4508/events","html_url":"https://github.com/centreon/centreon/issues/4508","id":163673362,"number":4508,"title":"Backslash and double backslash are removed after saving / command execution","user":{"login":"usolved","id":7000970,"avatar_url":"https://avatars.githubusercontent.com/u/7000970?v=3","gravatar_id":"","url":"https://api.github.com/users/usolved","html_url":"https://github.com/usolved","followers_url":"https://api.github.com/users/usolved/followers","following_url":"https://api.github.com/users/usolved/following{/other_user}","gists_url":"https://api.github.com/users/usolved/gists{/gist_id}","starred_url":"https://api.github.com/users/usolved/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/usolved/subscriptions","organizations_url":"https://api.github.com/users/usolved/orgs","repos_url":"https://api.github.com/users/usolved/repos","events_url":"https://api.github.com/users/usolved/events{/privacy}","received_events_url":"https://api.github.com/users/usolved/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-04T13:06:58Z","updated_at":"2016-07-19T22:09:21Z","closed_at":null,"body":"This is a similar bug like mentioned in #4145 and https://forum.centreon.com/forum/centreon-ui/centreon-web-interface/140283-problems-with-vanished-backslashes and still occures on other places.\r\n\r\nI'm using centreon-engine 1.5.0 with centreon web 2.7.4.\r\nIt works perfectly on command line but not with centreon-engine.\r\n\r\n**Example 1: Within the command**\r\n\r\nCommand definition:\r\n\r\n`$USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c check_drivesize -a \"filter=type in ('fixed','remote')\" \"show-all\" \"warn=used > $ARG1$\" \"crit=used > $ARG2$\" $ARG3$`\r\n\r\nTo exclude disks NSClient syntax has to be ($ARG3$):\r\nexclude=E:\\\\\\\r\n\r\n(yes, a double backslash).\r\nIf a \\\\\\ is at the the end of the string (no matter if it's in the command line or argument example text field) it is vanished after saving it. If it's within the string, it'll be saved fine.\r\n\r\nSo the exclude E: would work, but not the exclude F: (because the last backslashes will be vanished after saving):\r\n`$USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c check_drivesize -a \"filter=type in ('fixed','remote')\" \"show-all\" \"warn=used > $ARG1$\" \"crit=used > $ARG2$\" exclude=E:\\\\ exclude=F:\\\\`\r\n\r\n**Example 2: Within the service**\r\n\r\nIf I fill in exclude=E:\\\\\\ as $ARG3$ in the service itself the backslashes are safed fine, but aren't processed to centreon engine correctly (services.cfg looks fine with both backslashes after export). \r\n\r\n```\r\ndefine service {\r\n    host_name                      ... \r\n    service_description            Disks \r\n    check_command                  check_nrpe_disks!85%!95%!exclude=E:\\\\ \r\n    register                       1 \r\n    use                            windows_disks_nrpe \r\n    _SERVICE_ID                    355 \r\n}\r\n```\r\n\r\nThe debug log shows:\r\n\r\n`raw::run: cmd='/usr/lib/nagios/plugins/check_nrpe -H ... -p 5666 -c check_drivesize -a \"filter=type in ('fixed','remote')\" \"show-all\" \"warn=used > 85%\" \"crit=used > 95%\" exclude=E:register                       1', timeout=60`\r\n\r\nAs you see, the \\\\\\ are missing after E: (and a \"register 1\" was somehow added) on the raw command, even it they exists in the generated config file.\r\n\r\n\r\nI tried to double escape it like \\\\\\\\\\\\\\\\ or even //, putting \" or ' around the argument but nothing works."},"comment":{"url":"https://api.github.com/repos/centreon/centreon/issues/comments/233781861","html_url":"https://github.com/centreon/centreon/issues/4508#issuecomment-233781861","issue_url":"https://api.github.com/repos/centreon/centreon/issues/4508","id":233781861,"user":{"login":"julienmathis","id":2294502,"avatar_url":"https://avatars.githubusercontent.com/u/2294502?v=3","gravatar_id":"","url":"https://api.github.com/users/julienmathis","html_url":"https://github.com/julienmathis","followers_url":"https://api.github.com/users/julienmathis/followers","following_url":"https://api.github.com/users/julienmathis/following{/other_user}","gists_url":"https://api.github.com/users/julienmathis/gists{/gist_id}","starred_url":"https://api.github.com/users/julienmathis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julienmathis/subscriptions","organizations_url":"https://api.github.com/users/julienmathis/orgs","repos_url":"https://api.github.com/users/julienmathis/repos","events_url":"https://api.github.com/users/julienmathis/events{/privacy}","received_events_url":"https://api.github.com/users/julienmathis/received_events","type":"User","site_admin":false},"created_at":"2016-07-19T22:09:21Z","updated_at":"2016-07-19T22:09:21Z","body":"@ganoze : can you help us on this case ?"}}
{"actor":{"display_login":"julienmathis"}}