{"action":"created","issue":{"url":"https://api.github.com/repos/sensu/sensu-go/issues/2317","repository_url":"https://api.github.com/repos/sensu/sensu-go","labels_url":"https://api.github.com/repos/sensu/sensu-go/issues/2317/labels{/name}","comments_url":"https://api.github.com/repos/sensu/sensu-go/issues/2317/comments","events_url":"https://api.github.com/repos/sensu/sensu-go/issues/2317/events","html_url":"https://github.com/sensu/sensu-go/issues/2317","id":379947791,"node_id":"MDU6SXNzdWUzNzk5NDc3OTE=","number":2317,"title":"Systemd vs sensu-agent start paths are different","user":{"login":"asachs01","id":898627,"node_id":"MDQ6VXNlcjg5ODYyNw==","avatar_url":"https://avatars0.githubusercontent.com/u/898627?v=4","gravatar_id":"","url":"https://api.github.com/users/asachs01","html_url":"https://github.com/asachs01","followers_url":"https://api.github.com/users/asachs01/followers","following_url":"https://api.github.com/users/asachs01/following{/other_user}","gists_url":"https://api.github.com/users/asachs01/gists{/gist_id}","starred_url":"https://api.github.com/users/asachs01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asachs01/subscriptions","organizations_url":"https://api.github.com/users/asachs01/orgs","repos_url":"https://api.github.com/users/asachs01/repos","events_url":"https://api.github.com/users/asachs01/events{/privacy}","received_events_url":"https://api.github.com/users/asachs01/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-11-12T20:52:42Z","updated_at":"2018-11-14T21:29:54Z","closed_at":null,"author_association":"NONE","body":"In testing out the [monitoring external resources guide](https://docs.sensu.io/sensu-go/5.0/guides/monitor-external-resources/), it seems that there is a difference between the $PATH used by `systemd` and `sensu-agent`:\r\n\r\n**systemd**\r\n\r\n![systemctl-agent-path](https://user-images.githubusercontent.com/898627/48374233-3abeda00-e692-11e8-8b98-9304fc4be339.png)\r\n\r\n**sensu-agent**\r\n\r\n![sensu-start-path](https://user-images.githubusercontent.com/898627/48374248-44484200-e692-11e8-9116-768c0eee092e.png)\r\n\r\nIf one has to use `sensu-agent start`, or chooses to use this over an operating system service manager (or wouldn't have access to one), then this particular check would not work due to the differences in the respective paths. \r\n\r\nAre these expected to be different? Is this simply a case of using the sensu-agent workflow when we should be using an OS service manager instead? "},"comment":{"url":"https://api.github.com/repos/sensu/sensu-go/issues/comments/438825553","html_url":"https://github.com/sensu/sensu-go/issues/2317#issuecomment-438825553","issue_url":"https://api.github.com/repos/sensu/sensu-go/issues/2317","id":438825553,"node_id":"MDEyOklzc3VlQ29tbWVudDQzODgyNTU1Mw==","user":{"login":"asachs01","id":898627,"node_id":"MDQ6VXNlcjg5ODYyNw==","avatar_url":"https://avatars0.githubusercontent.com/u/898627?v=4","gravatar_id":"","url":"https://api.github.com/users/asachs01","html_url":"https://github.com/asachs01","followers_url":"https://api.github.com/users/asachs01/followers","following_url":"https://api.github.com/users/asachs01/following{/other_user}","gists_url":"https://api.github.com/users/asachs01/gists{/gist_id}","starred_url":"https://api.github.com/users/asachs01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asachs01/subscriptions","organizations_url":"https://api.github.com/users/asachs01/orgs","repos_url":"https://api.github.com/users/asachs01/repos","events_url":"https://api.github.com/users/asachs01/events{/privacy}","received_events_url":"https://api.github.com/users/asachs01/received_events","type":"User","site_admin":false},"created_at":"2018-11-14T21:29:54Z","updated_at":"2018-11-14T21:29:54Z","author_association":"NONE","body":"@echlebek so the check (as it currently stands) doesn't dump the output to STDOUT:\r\n\r\n```\r\n#!/usr/bin/env bash\r\n\r\ntarget=$1\r\n\r\ncurl --silent --connect-timeout 5 $target > /dev/null\r\nif [ $? -ne 0 ]; then\r\n  exit 1\r\nfi\r\n\r\nexit 0\r\n```\r\n\r\nBut, as a user, I can run it just fine:\r\n```\r\n[asachs@k8s000 ~]$ /usr/local/bin/http_check_silent.sh https://sensu.io && echo $?\r\n0\r\n```\r\nMy $PATH for reference:\r\n```\r\n[asachs@k8s000 ~]$ echo $PATH\r\n/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/asachs/.local/bin:/home/asachs/bin\r\n```\r\n\r\nUsing `sensu-agent start` from that user:\r\n```\r\n[asachs@k8s000 ~]$ sensu-agent start --backend-url ws://192.168.156.232:8081 --subscriptions linux-hosts\r\n{\"component\":\"cmd\",\"error\":\"open /var/cache/sensu/sensu-agent/assets.db: permission denied\",\"level\":\"fatal\",\"msg\":\"error executing sensu-agent\",\"time\":\"2018-11-14T15:27:36-06:00\"}\r\n```\r\n\r\nWorks fine w/ sudo:\r\n```\r\n[asachs@k8s000 ~]$ sudo !!\r\nsudo sensu-agent start --backend-url ws://192.168.156.232:8081 --subscriptions linux-hosts\r\n\r\n```\r\nBut still has a difference in path between using `systemctl` and `sensu-agent`:\r\n![sudo-sensu-agent](https://user-images.githubusercontent.com/898627/48513718-80160f80-e82a-11e8-8b34-4643d724d6c7.png)\r\n"}}
{"actor":{"display_login":"asachs01"}}