@@ -19,10 +19,28 @@ scale factor.
1919Currently, reads rocm-smi output, but the intent it to read any JSON based
2020on a declarative config file.
2121
22+ # Architecture
23+
24+ ``` mermaid
25+ graph TD;
26+ snmp-manager --> snmp-agent
27+ snmp-agent --> agentx
28+ agentx --> json-command
29+ ```
30+
31+ The snmp-manager is an app like Zabbix. The SNMP Agent runs on each host. For
32+ a typical linux host this would be NET-SNMP.
33+
34+ Instead of writing a full-blown SNMP Agent for each thing you want to monitor,
35+ Net-SNMP has a plugin architecture. Net-SNMP creates a unix socket (or TCP
36+ port) and listens for connections there. This subagent reads and writes to
37+ that socket.
38+
2239# Build
2340
2441``` shell
2542cargo build
43+ cargo clippy
2644```
2745
2846
@@ -33,21 +51,14 @@ Could use some help with setting up unit tests.
3351
3452# Run
3553
36- Customize the config and run locally
37-
38- ```
39- cp template/config.yaml .
40- cargo run
41- ```
42-
43- Find the agentx socket file in /var, likely /var/agentx/master.
44-
45-
46- # Deploy
54+ You could run this with a standalone SNMP Agent (NET-SNMP) or you can use the
55+ sytem-wide instance. Set up your agent like this.
4756
4857## Set up SNMPd
4958
50- Add this to SNMPd's config /etc/snmp/snmpd.conf.
59+ Add this to SNMPd's config /etc/snmp/snmpd.conf. PEN is the private enterprise
60+ number. Request one [ here] ( https://www.iana.org/assignments/enterprise-numbers/ ) .
61+ You can create the socket file to be used by yourself or the system.
5162
5263```
5364# Add your OID to the system view
@@ -60,17 +71,32 @@ agentxsocket /tmp/agentx
6071agentxperms 770 770 <username> <groupname>
6172```
6273
63- Load the MIB file.
64-
65- TODO
74+ The system-level agentx socket is ` /var/agentx/master ` . Maybe a better place
75+ for a user-level socket is in ` ~/.local/double-agentx/ ` .
6676
6777Confirm the MIB file has the right structure.
6878
6979``` shell
7080snmptranslate -M.:/usr/share/snmp/mibs/ietf -Tp AMDGPU-MIB::doubleagentx
7181```
7282
73- Run these commands.
83+ Load the MIB file.
84+
85+ TODO
86+
87+
88+ ## Set up the app
89+
90+ Customize the config and run locally
91+
92+ ```
93+ cp template/config.yaml .
94+ RUST_LOG=debug cargo run
95+ ```
96+
97+ # Deploy
98+
99+ Run these commands and customize files.
74100
75101``` shell
76102cargo build --release
@@ -84,11 +110,13 @@ Find the new binary in `target/release/double-agentx` and copy it to wherever yo
84110
85111# Systemd
86112
113+ Systemd runs at the user-level.
114+
87115After copying the service file and config file into place, customize them.
88116
89117``` shell
90- cp double-agentx.service ~ /.config/systemd/user/
91- cp config.yaml ~ /.config/double-agentx/
118+ cp template/ double-agentx.service ~ /.config/systemd/user/
119+ cp template/ config.yaml ~ /.config/double-agentx/
92120systemctl daemon-reload
93121systemctl enable --user double-agentx.service
94122systemctl start --user double-agentx.service
@@ -97,7 +125,7 @@ systemctl start --user double-agentx.service
97125Monitor logs
98126
99127``` shell
100- journalctl --user -fu agentx
128+ journalctl --user -fu double- agentx
101129```
102130
103131# Acknowledgements
0 commit comments