Skip to content

Instantly share code, notes, and snippets.

/opt/datadog-agent/embedded/bin/python
Python 2.7.12 (default, Sep 29 2016, 21:18:00)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.getfqdn()
curl -o mib-jnx-if-extensions.txt http://www.juniper.net/techpubs/en_US/junos12.3/topics/reference/mibs/mib-jnx-if-extensions.txt
/opt/datadog-agent/bin/build-pysnmp-mib -o mib-jnx-if-extensions.py mib-jnx-if-extensions.txt
sudo su
mkdir /opt/mibs
cp -p mib-jnx-if-extensions.py /opt/mibs/JUNIPER-IF-MIB.py
@jhotta
jhotta / as_count()
Created July 5, 2016 08:01
as_count()
{
"requests": [
{
"q": "avg:aws.elb.httpcode_elb_5xx{*} by {host}.as_count()",
"type": "bars",
"conditional_formats": [],
"aggregator": "avg"
}
],
"viz": "timeseries"
@jhotta
jhotta / gist:cdb666704aebb1b2edd0cdde5aff2b1f
Created June 28, 2016 06:12
"Say what's happening" message syntax
{{#is_alert}}
Redis memory usage is over 80 percent on Redis Production
@all @hipchat-DPMS
{{/is_alert}}
{{#is_warning}}
Redis memory usage is over 60 percent on Redis Production
@all @hipchat-DPMS
{{/is_warning}}
message = "{{#is_alert}} Load average is high! @slack-xyk_alert {{/is_alert}} {{#is_recovery}} Load average is OK @slack-xyk_alert {{/is_recovery}} "
Example#1:
{{#is_alert}}sample error message @jay@datadog @slack-ops-test {{/is_alert}}
Example#2:
sample error message
{{#is_alert}} @jay@datadog @slack-ops-test @pagerduty {{/is_alert}}
{{#is_warning}}@slack-channel_name @someone-email{{is_warning}}
{{#is_alert}}@slack-channel_name @someone-email @pagerduty{{/is_alert}}
@jhotta
jhotta / file0.txt
Last active October 15, 2015 10:57
Datadogで収集しているメトリクスを、Query処理する際に目から鱗が落ちた! ref: http://qiita.com/jhotta/items/ae98274ce358e442f01d
top(avg:aws.elb.latency{*} by {host}, 2, 'max', 'desc') * 1000 > 5000
@jhotta
jhotta / file0.txt
Created August 28, 2015 16:15
Datadog Agentのインストール問題でサポートを受ける場合のお助けコマンド。 ref: http://qiita.com/jhotta/items/782de6a06d917a3825b9
sudo /etc/init.d/datadog-agent flare {case_id}
gettext:
sphinx-build -b gettext docs_all/source build/locale-all
sphinx-build -b gettext chef_master/source build/locale-master
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
epub:
sphinx-build -b epub docs_all/source build/epub-all
sphinx-build -b epub chef_master/source build/epub-master
@echo