Skip to content

Instantly share code, notes, and snippets.

@uozias
Last active November 19, 2015 05:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uozias/9d115f201960b1385349 to your computer and use it in GitHub Desktop.
Save uozias/9d115f201960b1385349 to your computer and use it in GitHub Desktop.
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