Sensu-agent not running - Solved

Hey,
I need some clarity as to which amazon linux version you are running as to avoid confusion. amazon linux(based on centos6) uses upstart for its init, and amazon linux 2 uses systemd (based on centos7). So the instructions on how to troubleshoot a running service will be different. Once I know for sure which init system you using, I’ll be able to give you detailed instructions.

But for now here’s how I would go about troubleshooting the different options

Amazon Linux (centos6)
If you are running amazon linux based on centos6 you should see this file:

/etc/init.d/sensu-agent

and log messages from service start up attempts should be in /var/log/sensu/sensu-agent.log. This service script uses a pretty advanced start up that requires chroot to be installed. Look at the start() function in that file to see what’s invovled.
Possible problems you make be having include:

  • chroot command is not available
  • sensu user does not have permissions to write into /var/log/sensu/ or /var/run/sensu/

Amazon Linux 2 (centos7)
If you are running amazon linux 2 based on centos7 you should see this file:

/usr/lib/systemd/system/sensu-agent.service

Troubleshooting the systemd based service is much easier, as you can make use of journalctl to look at the logs from sensu-agent start up failures.