Hello guys I'm trying to create a sensu check in python that requires a shell but is currently giving me a tty error.
cmd = '/usr/bin/pstorage stat |grep %s |grep failed' % hostname
output = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True).communicate()[0]
Sensu by default doesn't have a tty so when it tries to execute the script
sudo /etc/sensu/plugins/diskauto.py --storage_name pool-01
the output is
sudo: no tty present and no askpass program specified
I already have the following sudo rule in place
Cmnd_Alias DRIVE_AUTOMATION=/apptio/scripts/diskauto.py