Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Setup Mackerel Log Cheking for AWS Elasticbeanstalk
commands:
01_enable_sudo:
command: "echo Defaults:root !requiretty >> /etc/sudoers"
packages:
rpm:
mackerel: "https://mackerel.io/file/agent/rpm/mackerel-agent-latest.noarch.rpm"
commands:
set_mackerel_repo:
command: "curl -fsSL https://mackerel.io/assets/files/scripts/setup-yum.sh | sh"
ignoreErrors: true
packages:
yum:
mackerel-check-plugins: []
files:
/etc/mackerel-agent/mackerel-agent.conf:
mode: "00644"
owner: root
group: root
encoding: plain
content: |
apikey = "YourAPIKey"
[plugin.checks.application_log]
command = "/usr/local/bin/check-log --file /var/app/current/log/production.log --pattern FATAL"
[plugin.checks.check_cron]
command = "/usr/local/bin/check-procs -p crond"
[plugin.metrics.crawl_cron_number]
command = ' num=$(tail -n 10 /var/app/current/log/production.log | grep -c /some_task) ; echo "cron_number.some_task ${num} $(date +%s)" '
commands:
start_mackerel_agent:
command: "/etc/init.d/mackerel-agent restart"
ignoreErrors: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment