|
1 |
| -# Simp |
| 1 | +# SIMP |
2 | 2 |
|
3 |
| -A small system for gathering large amounts of snmp data. The pacakge contains both a collector and a data service interface. A multi-process collector gathers SNMP data from a set of hosts and put that data into a local Redis database. A set of data services then provides access to this data via RabbitMQ. Currently this code is PoC without proper init scripts etc, so the following is a bit... rustic. |
| 3 | +SIMP is a small system for gathering large amounts of snmp data. |
| 4 | + |
| 5 | +The pacakge contains both a collector and a data service interface. |
| 6 | +A multi-process collector gathers SNMP data from a set of hosts and puts that data into a redis database. |
| 7 | +A set of data services then provides access to this data via RabbitMQ. |
4 | 8 |
|
5 | 9 | ## Running The Collector
|
6 | 10 |
|
| 11 | +You will need a redis and rabbit server, accesible to the SIMP daemons. |
| 12 | + |
7 | 13 | For now, you should have redis and rabbitmq installed locally and running.
|
8 | 14 |
|
9 |
| -```sh |
10 |
| -./simp.pl --config /home/ebalas/config.xml --logging ../logging.conf |
| 15 | +```bash |
| 16 | +simp-poller.pl --config /etc/simp/poller/config.xml --logging /etc/simp/poller/logging.conf --user simp --group simp |
11 | 17 | ```
|
12 | 18 |
|
13 |
| -The config file controls collection interval, and the number of workers to use and what to collect. |
| 19 | +The config files controls collection interval, and the number of workers to use and what to collect. |
14 | 20 |
|
15 | 21 | ```xml
|
16 |
| -<!-- |
17 |
| - config.xml defines the config for the simp collector, with the individual hosts defined in hosts.conf |
18 |
| ---> |
| 22 | +<?xml version="1.0" encoding="UTF-8" ?> |
19 | 23 |
|
| 24 | +<!-- Simp-Poller Main Configuration --> |
20 | 25 | <config>
|
21 |
| - <! -- redis: defines how to connect to redis, which is used for data storage --> |
22 |
| - <redis host="127.0.0.1" port="6379"/> |
23 |
| - |
24 |
| - <group name="int" active="1" workers="2" interval="60" retention="6"> |
25 |
| - <!-- mib: specifies the data to gather using getTree |
26 |
| - oid: is set to an oid substing expressed as dotted decimal |
27 |
| - --> |
28 |
| - <mib oid="1.3.6.1.2.1.2.2"/> |
29 |
| - <mib oid="1.3.6.1.2.1.31.1.1.1"/> |
30 |
| - </group> |
| 26 | + <!-- Redis host connection information --> |
| 27 | + <redis ip="127.0.0.1" port="6379" reconnect="60" reconnect_every="500" read_timeout="2" write_timeout="3" /> |
31 | 28 |
|
32 |
| - <group name="bgp" active="0" workers="2" interval="30" retention="2"> |
33 |
| - <mib oid="1.3.6.1.2.1.15"/> |
34 |
| - </group> |
| 29 | + <!-- How long to keep data in Redis before purging (seconds) --> |
| 30 | + <purge interval="3600" /> |
35 | 31 |
|
36 |
| - <group name="mac2ip" active="0" workers="5" interval="60" retention="2" |
37 |
| - <mib oid="1.3.6.1.2.1.17.4.3"/> |
38 |
| - </group> |
| 32 | + <!-- Default num of results to get per SNMP request --> |
| 33 | + <request_size results="15" /> |
39 | 34 |
|
| 35 | + <!-- Where to write status files --> |
| 36 | + <status dir="/var/lib/simp/poller/" /> |
40 | 37 | </config>
|
41 | 38 | ```
|
42 | 39 |
|
43 |
| -The host.conf file contains the set of hosts to collect from and defines the collection group assignments |
| 40 | +You will need at least one group definition in /etc/simp/poller/groups.d. |
| 41 | +Here is an example all_interfaces.xml group. |
| 42 | + |
| 43 | +```xml |
| 44 | +<?xml version="1.0" encoding="UTF-8" ?> |
| 45 | + |
| 46 | +<group workers="1" interval="60" timeout="15"> |
| 47 | + <mib oid="1.3.6.1.2.1.31.1.1.1.6" /> <!-- inHCbytes --> |
| 48 | + <mib oid="1.3.6.1.2.1.31.1.1.1.10" /> <!-- outHCbytes --> |
| 49 | + <mib oid="1.3.6.1.2.1.2.2.1.14" /> <!-- inerror --> |
| 50 | + <mib oid="1.3.6.1.2.1.2.2.1.20" /> <!-- outerror --> |
| 51 | + <mib oid="1.3.6.1.2.1.2.2.1.11" /> <!-- inUcast --> |
| 52 | + <mib oid="1.3.6.1.2.1.2.2.1.17" /> <!-- outUcast --> |
| 53 | + <mib oid="1.3.6.1.2.1.2.2.1.13" /> <!-- indiscard --> |
| 54 | + <mib oid="1.3.6.1.2.1.2.2.1.19" /> <!-- outdiscard --> |
| 55 | + <mib oid="1.3.6.1.2.1.2.2.1.7" /> <!-- ifAdminStatus --> |
| 56 | + <mib oid="1.3.6.1.2.1.2.2.1.8" /> <!-- ifOperStatus --> |
| 57 | + <mib oid="1.3.6.1.2.1.31.1.1.1.1" /> <!-- ifName --> |
| 58 | + <mib oid="1.3.6.1.2.1.31.1.1.1.18" /> <!-- ifAlias --> |
| 59 | +</group> |
| 60 | +``` |
| 61 | + |
| 62 | +And you need a file in /etc/simp/poller/hosts.d to define the device collections. |
| 63 | +The group id must match the file name in /etc/simp/poller/groups.d. |
44 | 64 |
|
45 | 65 | ```xml
|
| 66 | +<?xml version="1.0" encoding="UTF-8"?> |
| 67 | + |
46 | 68 | <config>
|
47 |
| - <host ip="10.13.1.2" community="come on"> |
48 |
| - <group id="int"/> |
49 |
| - <group id="bgp"/> |
50 |
| - </host> |
51 |
| - <host ip="10.13.1.1" community="farva man"> |
52 |
| - <group id="int"/> |
53 |
| - <group id="bgp"/> |
54 |
| - </host> |
55 |
| - <host ip="10.13.2.2" community="same"> |
56 |
| - <group id="int"/> |
57 |
| - </host> |
58 |
| - <host ip="10.13.2.1" community="team"> |
59 |
| - <group id="mac2ip"/> |
60 |
| - </host> |
61 |
| - </group> |
| 69 | + <!-- Connecticut Education 24x7-mem nodes --> |
| 70 | + <host name="switch2.example.host" ip="1.1.1.1" community="its_a_secret_to_everyone" snmp_version="2c"> |
| 71 | + <group id="all_interfaces" /> |
| 72 | + </host> |
62 | 73 | </config>
|
63 | 74 | ```
|
64 | 75 |
|
65 | 76 | ## Running the Data Service
|
66 | 77 |
|
67 |
| -```sh |
68 |
| -./simpData.pl --config ../simpDataConfig.xml --logging ../logging.conf |
| 78 | +```bash |
| 79 | +/usr/bin/simp-data.pl --config /etc/simp/data/config.xml --logging /etc/simp/data/logging.conf --user simp --group simp |
69 | 80 | ```
|
70 | 81 |
|
71 | 82 | The config is similar to that used by the poller with less details required.
|
72 | 83 |
|
73 | 84 | ```xml
|
74 |
| -<config workers="3" > |
75 |
| - <redis host="127.0.0.1" port="6379"/> |
76 |
| - <rabbitMQ host="127.0.0.1" port="5672"/> |
| 85 | +<?xml version="1.0" encoding="UTF-8" ?> |
| 86 | + |
| 87 | +<!-- Simp-Data Main Config --> |
| 88 | +<config workers="4"> |
| 89 | + <redis ip="127.0.0.1" port="6379" reconnect="60" reconnect_every="500" read_timeout="2" write_timeout="3" /> |
| 90 | + <rabbitmq ip="127.0.0.1" port="5672" user="guest" password="guest" /> |
| 91 | +</config> |
| 92 | +``` |
| 93 | + |
| 94 | +## Running the composite service |
| 95 | + |
| 96 | +```bash |
| 97 | +/usr/bin/simp-comp.pl --config /etc/simp/comp/config.xml --logging /etc/simp/comp/logging.conf --user simp --group simp |
| 98 | +``` |
| 99 | + |
| 100 | +Config example: |
| 101 | + |
| 102 | +```xml |
| 103 | +<?xml version="1.0" encoding="UTF-8" ?> |
| 104 | + |
| 105 | +<config workers="4"> |
| 106 | + <rabbitmq ip="127.0.0.1" port="5672" user="guest" password="guest" /> |
77 | 107 | </config>
|
78 | 108 | ```
|
79 | 109 |
|
80 | 110 | ## Testing
|
81 | 111 |
|
82 | 112 | #### Testing information can be found [here](https://github.com/GlobalNOC/simp/tree/master/t)
|
83 |
| - |
|
0 commit comments