Skip to content

Instantly share code, notes, and snippets.

View ajohnstone's full-sized avatar

Andrew Johnstone ajohnstone

View GitHub Profile
[cache]
# Configure carbon directories.
#
# OS environment variables can be used to tell carbon where graphite is
# installed, where to read configuration from and where to write data.
#
# GRAPHITE_ROOT - Root directory of the graphite installation.
# Defaults to ../
# GRAPHITE_CONF_DIR - Configuration directory (where this file lives).
# Defaults to $GRAPHITE_ROOT/conf/
mkdir -p /opt/graphite/storage
mount -onoatime,nodiratime,nobarrier -t xfs /dev/xvdf /opt/graphite/storage
find /opt/graphite/storage/whisper/stats/collectd_bk -type f | while read file; do
dest=$(echo $file | sed 's/collectd_bk/collectd/g')
mkdir -p $(dirname $dest)
echo $dest;
rsync --recursive --perms --times --whole-file --ignore-existing $file $dest;
if [ -e "$file" ]; then
# Uncomment the next line to enable TCP/IP SYN cookies
net.ipv4.tcp_syncookies=0
# Uncomment the next two lines to enable Spoof protection (reverse-path filter)
# Turn on Source Address Verification in all interfaces to
# prevent some spoofing attacks
net.ipv4.conf.default.rp_filter=1
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
root@ip-10-239-75-244:~# FACTER_server_tags="role:hadoop-master=true,role:hadoop-worker=true" puppet apply --verbose -vvv --debug --modulepath /etc/puppet/modules /etc/puppet/manifests/site.pp
Debug: importing '/etc/puppet/modules/truth/manifests/enforcer.pp' in environment production
Debug: Automatically imported truth::enforcer from truth/enforcer into production
Error: Unknown function has_role at /etc/puppet/modules/truth/manifests/enforcer.pp:4 on node ip-10-239-75-244.eu-west-1.compute.internal
Error: Unknown function has_role at /etc/puppet/modules/truth/manifests/enforcer.pp:4 on node ip-10-239-75-244.eu-west-1.compute.internal
icinga.cfg
# Uncomment this to enable idomod.o
# Don't forget to also enable the daemon in /etc/default/icinga
broker_module=/usr/lib/icinga/idomod.so config_file=/etc/icinga/idomod.cfg
in modules/idomod.cfg i have
define module {
module_name ido_mod
path /usr/lib/icinga/idomod.so
mysql> SELECT * FROM icinga_conninfo;
+-------------+-------------+------------------------+---------------+-------------+----------------+--------------+---------------------+---------------------+---------------------+---------------------+---------------------+-----------------+-----------------+-------------------+
| conninfo_id | instance_id | agent_name | agent_version | disposition | connect_source | connect_type | connect_time | disconnect_time | last_checkin_time | data_start_time | data_end_time | bytes_processed | lines_processed | entries_processed |
+-------------+-------------+------------------------+---------------+-------------+----------------+--------------+---------------------+---------------------+---------------------+---------------------+---------------------+-----------------+-----------------+-------------------+
| 1 | 1 | IDOMOD | 1.7.1 | REALTIME | TCPSOCKET | INITIAL | 2012-11-09 16:03:47
mysql> SELECT * FROM icinga_commands WHERE command_line LIKE '%check_ntp_time%';
+------------+-------------+-------------+-----------+-----------------------------------------+
| command_id | instance_id | config_type | object_id | command_line |
+------------+-------------+-------------+-----------+-----------------------------------------+
| 95 | 1 | 0 | 95 | $USER1$/check_ntp_time -H $HOSTADDRESS$ |
| 301 | 1 | 1 | 95 | $USER1$/check_ntp_time -H $HOSTADDRESS$ |
+------------+-------------+-------------+-----------+-----------------------------------------+
2 rows in set (0.02 sec)
root@icinga:/etc/icinga# dpkg -l | grep icinga
ii icinga 1.7.1-1~ppa2~precise1 host and network monitoring system - metapackage
ii icinga-cgi 1.7.1-1~ppa2~precise1 host and network monitoring system - CGI scripts
ii icinga-common 1.7.1-1~ppa2~precise1 host and network monitoring system - support files
ii icinga-core 1.7.1-1~ppa2~precise1 host and network monitoring system - core files
ii icinga-doc 1.7.1-1~ppa2~precise1 host and network monitoring system - documentation
ii icinga-idoutils 1.7.1-1~ppa2~precise1 host and network monitoring system - icinga-dataobjects support
ii icinga-web 1.7.1-1~ppa1 host and network monitoring system - modern web interface
ii icinga-web-pnp 1.7.1-1~ppa1 host and networ
Index
andrew@andrew-OptiPlex-7010:~$ curl -s http://localhost:9200/pbx_members/Member/_mapping?pretty=true
{
"Member" : {
"properties" : {
"first_name" : {
"type" : "multi_field",
"fields" : {
"first_name" : {
$params = array(
'filterfields'=>array('member_id'),
'filtervalues'=> range(1,10000),
'count'=>100,
'object_property_filter' => array(
'Community.Member' => array(
'first_name' => 'r',
'last_name' => 'r',
),
),