Module Expr Str Import alias TryExcept body Import alias Import alias Expr NameLoad handlers ExceptHandler type NameLoad body Assign NameStore NameLoad ClassDef bases AttributeLoad AttributeLoad NameLoad attr attr body FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad Call NameLoad NameLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Dict Str Str Str Str Str Str Str Str Str Str BinOpAdd Str Str BinOpAdd BinOpAdd BinOpAdd Str Str Str Str Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call NameLoad NameLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Dict Str Str Str Str Str Str Str Str Str Str Str Str Num Str Str Dict Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body If CompareIs NameLoad NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Return Dict Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Str If UnaryOpNot NameLoad body Assign NameStore Dict Str Dict Str Str Str Str For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Str Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Str Assign NameStore BoolOpOr Call AttributeLoad NameLoad attr Str SubscriptLoad AttributeLoad NameLoad attr Index Str Assign NameStore BoolOpOr Call AttributeLoad NameLoad attr Str SubscriptLoad AttributeLoad NameLoad attr Index Str Assign NameStore BoolOpOr Call AttributeLoad NameLoad attr Str SubscriptLoad AttributeLoad NameLoad attr Index Str Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Expr ListComp Call AttributeLoad NameLoad attr NameLoad NameLoad comprehension TupleStore NameStore NameStore NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Num Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad Dict Str Str NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore ListLoad For NameStore Call AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr TupleLoad BinOpMod NameLoad Dict Str Str NameLoad Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str Return NameLoad decorator_list decorator_list
N/A N/A 
Collect slony metrics from postgresql

#### Dependencies

 * psycopg2

#### Example Configuration

```
enabled = True

host = localhost
port = 5432
slony_node_string = Node [0-9] - [_a-z0-9]*@(.*).example.com

[instances]

[[database1]]
slony_db = postgres
slony_schema = _slony


[[database2]]
user = postgres
password = postgres
slony_db = data_db
slony_node_string = Node [0-9] - [_a-z0-9]*@(.*).i.example.com
slony_schema = _data_db
```

 N/A diamond.collector N/A N/A N/A psycopg2 N/A psycopg2.extensions N/A psycopg2 N/A N/A N/A ImportError N/A N/A psycopg2 None SlonyCollector N/A N/A N/A diamond collector Collector N/A get_default_config_help N/A N/A self N/A N/A N/A config_help N/A N/A N/A super SlonyCollector self get_default_config_help N/A N/A N/A config_help update N/A host user password port slony_node_string instances Hostname Username Password Port number N/A Regex for SQL SUBSTRING to extract  the hostname from sl_node.no_comment N/A N/A N/A Subcategory of slony instances that includes the  slony database, and slony schema to be monitored.  Optionally, user, password and slony_node_string  maybe overridden per instance (see example). N/A config_help N/A get_default_config N/A N/A self N/A N/A N/A 
        Return default config.
         N/A config N/A N/A N/A super SlonyCollector self get_default_config N/A N/A N/A config update N/A path host user password port slony_node_string method instances postgres localhost postgres postgres 5432 Node [0-9]+ - postgres@localhost Threaded N/A N/A config N/A collect N/A N/A self N/A N/A N/A N/A psycopg2 None N/A N/A N/A N/A N/A self log error Unable to import module psycopg2 N/A N/A N/A instances N/A N/A self config N/A instances N/A N/A instances N/A N/A instances N/A default N/A slony_db slony_schema postgres _postgres N/A N/A name instance N/A N/A instances iteritems N/A N/A host N/A N/A self config N/A host N/A port N/A N/A self config N/A port N/A user N/A N/A N/A instance get user N/A N/A self config N/A user N/A password N/A N/A N/A instance get password N/A N/A self config N/A password N/A slony_node_string N/A N/A N/A instance get slony_node_string N/A N/A self config N/A slony_node_string N/A slony_db N/A instance N/A slony_db N/A slony_schema N/A instance N/A slony_schema N/A stats N/A N/A self _get_stats_by_database host port user password slony_db slony_schema slony_node_string N/A N/A N/A N/A self publish metric value N/A N/A metric value stats N/A _get_stats_by_database N/A N/A self host port user password db schema node_string N/A N/A N/A path slony.%(datname)s.%(metric)s.lag_events N/A conn N/A N/A psycopg2 connect host host user user password password port port database db N/A N/A N/A conn set_isolation_level 0 N/A query 
            SELECT SUBSTRING(sl.no_comment FROM %(node_extractor)s) AS node,
                   st.st_lag_num_events AS lag_events
            FROM %(schema)s.sl_status AS st, %(schema)s.sl_node AS sl
            WHERE sl.no_id = st.st_received
         N/A cursor N/A N/A conn cursor cursor_factory N/A N/A psycopg2 extras DictCursor N/A N/A N/A cursor execute query N/A node_extractor schema node_string N/A N/A N/A psycopg2 extensions AsIs schema N/A metrics N/A N/A row N/A N/A cursor fetchall N/A N/A stats N/A N/A row copy N/A N/A N/A metrics append N/A N/A path N/A datname metric db N/A N/A stats get node N/A N/A stats get lag_events N/A metrics N/A N/A