Skip to content

Instantly share code, notes, and snippets.

View ajohnstone's full-sized avatar

Andrew Johnstone ajohnstone

View GitHub Profile
<?php
$nodes = array_filter(explode(' ',$_SERVER['argv'][1]));
$memcache = new Memcached;
//$memcache->setOption ( Memcached::OPT_DISTRIBUTION , Memcached::DISTRIBUTION_MODULA );
$memcache->setOption ( Memcached::OPT_DISTRIBUTION , Memcached::DISTRIBUTION_CONSISTENT );
foreach($nodes AS $node) {
config.vm.provision :chef_solo do |chef|
#chef.recipe_url = "http://files.vagrantup.com/getting_started/cookbooks.tar.gz"
chef.cookbooks_path = "cookbooks"
#chef.add_recipe "mysql"
#chef.add_role "web"
#chef.add_role "apache2"
chef.add_recipe("vagrant_main")
# You may also specify custom JSON attributes:
chef.json = { :mysql_password => "foo" }
# -*- mode: ruby -*-
# vi: set ft=ruby :
nodes = {
'http' => [3, 10],
'db' => [2, 20],
}
Vagrant::Config.run do |config|
config.vm.box = "base"
andrew@andrew-OptiPlex-7010:/var/www/logs/bin$ ./apache-log-stat $(ls ../logs/b2f*_ApacheAccess.2011-12-05.gz)
Processing
====================
../logs/b2f01_ApacheAccess.2011-12-05.gz - avg_requests_per_second: 5.92 variance_requests_per_second: 25.93 total_requests: 413603 stddev_requests_per_second: 5.09 max_requests_per_second: 57
../logs/b2f02_ApacheAccess.2011-12-05.gz - avg_requests_per_second: 6.05 variance_requests_per_second: 26.55 total_requests: 417711 stddev_requests_per_second: 5.15 max_requests_per_second: 45
../logs/b2f03_ApacheAccess.2011-12-05.gz - avg_requests_per_second: 6.09 variance_requests_per_second: 26.64 total_requests: 419073 stddev_requests_per_second: 5.16 max_requests_per_second: 48
../logs/b2f04_ApacheAccess.2011-12-05.gz - avg_requests_per_second: 5.07 variance_requests_per_second: 12.82 total_requests: 325374 stddev_requests_per_second: 3.58 max_requests_per_second: 29
../logs/b2f05_ApacheAccess.2011-12-05.gz - avg_requests_per_
$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',
),
),
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" : {
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
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
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_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)