User has insufficient privilege

Hey, guys:
I’m trying to restart a service (say crond) after it was crashed through remediation handler. But I keeping get the following log in sensu-client.log
{
“timestamp”:“2015-05-19T14:37:08.536736+0800”,
“level”:“info”,
“message”:“publishing check result”,
“payload”:{
“client”:“virtual-client”,
“check”:{
“name”:“heavy_remediation”,
“command”:“service crond start”,
“issued”:1432017417,
“executed”:1432017428,
“duration”:0.015,
“output”:“User has insufficient privilege.\n”,
“status”:4
}
}
}

And if I add **sudo** to the command, the sensu-client complains with the following log:

"output": “sudo: sorry, you must have a tty to run sudo\n”, “status”: 1

How can I make sure that sensu user have sufficient privilege??? Thanks!!!

Hello,
This is a sudo issue not really a sensu one.
Here is where you can find how to fix this issue:

Regards,

Frédéric Médery
Infrastructure Manager

···

On 19 May 2015 at 02:44, Timothy John <tim_john@126.com> wrote:

Hey, guys:
    I'm trying to restart a service (say crond) after it was crashed through
remediation handler. But I keeping get the following log in sensu-client.log
{
  "timestamp":"2015-05-19T14:37:08.536736+0800",
  "level":"info",
  "message":"publishing check result",
  "payload":{
    "client":"virtual-client",
    "check":{
      "name":"heavy_remediation",
      "command":"service crond start",
      "issued":1432017417,
      "executed":1432017428,
      "duration":0.015,
      "output":"User has insufficient privilege.\n",
      "status":4
    }
  }
}

    And if I add sudo to the command, the sensu-client complains with the
following log:
"output": "sudo: sorry, you must have a tty to run sudo\n", "status": 1

    How can I make sure that sensu user have sufficient privilege???
Thanks!!!

Thanks a lot, Frederic! I’ve fix this problem following the guide you provide!

在 2015年5月19日星期二 UTC+8下午8:25:56,Frederic Medery写道:

···

Hello,
This is a sudo issue not really a sensu one.
Here is where you can find how to fix this issue:

https://www.shell-tips.com/2014/09/08/sudo-sorry-you-must-have-a-tty-to-run-sudo/

Regards,

Frédéric Médery
Infrastructure Manager

On 19 May 2015 at 02:44, Timothy John tim_...@126.com wrote:

Hey, guys:
I’m trying to restart a service (say crond) after it was crashed through
remediation handler. But I keeping get the following log in sensu-client.log
{
“timestamp”:“2015-05-19T14:37:08.536736+0800”,
“level”:“info”,
“message”:“publishing check result”,
“payload”:{
“client”:“virtual-client”,
“check”:{
“name”:“heavy_remediation”,
“command”:“service crond start”,
“issued”:1432017417,
“executed”:1432017428,
“duration”:0.015,
“output”:“User has insufficient privilege.\n”,
“status”:4
}
}
}

And if I add sudo to the command, the sensu-client complains with the

following log:
“output”: “sudo: sorry, you must have a tty to run sudo\n”, “status”: 1

How can I make sure that sensu user have sufficient privilege???

Thanks!!!