Projects/Spacestate: Difference between revisions
< Projects
No edit summary |
No edit summary |
||
(15 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
|name=Spacestate | |name=Spacestate | ||
|start=2016/09/19 | |start=2016/09/19 | ||
|contact= | |contact=Polyfloyd, AK47, | ||
|info=Opvolger van SpaceNotifier | |info=Opvolger van SpaceNotifier | ||
|status= | |status=Production | ||
|Picture=PAY_DEBTS.png | |||
}} | }} | ||
=== TODO & Issues === | |||
-> https://git.bitlair.nl/bitlair/infra/issues | |||
== | == Systeem == | ||
=== | === Spacestate === | ||
<pre> | <pre> | ||
root@service:/opt/spacestate# tree | root@service:/opt/spacestate# tree | ||
. | . | ||
|-- bitlair_closed.d | |||
| |-- 10_log | |||
| |-- 10_mqtt | |||
├── | | |-- 20_music_poweroff | ||
| |-- 21_bitpanel_poweroff | |||
| |-- 21_lounge_leds_poweroff | |||
| |-- 22_bank_off | |||
| |-- 22_phone_off | |||
| |-- 23_ledbanner_off | |||
| |-- 24_statsbank_off | |||
| |-- 80_irc | |||
| `-- 80_twitter | |||
|-- bitlair_open.d | |||
| |-- 10_log | |||
| |-- 10_mqtt | |||
| |-- 20_bank_on | |||
| |-- 20_bitpanel_poweron | |||
| |-- 20_lounge_leds_poweron | |||
| |-- 20_music_poweron | |||
| |-- 21_ledbanner_on | |||
| |-- 22_phone_on | |||
| |-- 22_statsbak_on | |||
| |-- 80_irc | |||
| `-- 80_twitter | |||
|-- djo_closed.d | |||
| |-- 10_mqtt | |||
| |-- 20_music_poweroff -> ../bitlair_closed.d/20_music_poweroff | |||
| |-- 21_bitpanel_poweroff -> ../bitlair_closed.d/21_bitpanel_poweroff | |||
| |-- 21_lounge_leds_poweroff -> /opt/spacestate/bitlair_closed.d/21_lounge_leds_poweroff | |||
| |-- 22_bank_off -> /opt/spacestate/bitlair_closed.d/22_bank_off | |||
| |-- 22_phone_off -> /opt/spacestate/bitlair_closed.d/22_phone_off | |||
| |-- 23_ledbanner_off -> /opt/spacestate/bitlair_closed.d/23_ledbanner_off | |||
| |-- 24_statsbak_off -> /opt/spacestate/bitlair_closed.d/24_statsbank_off | |||
| `-- 80_irc | |||
|-- djo_open.d | |||
| |-- 10_mqtt | |||
| |-- 20_bank_on -> /opt/spacestate/bitlair_open.d/20_bank_on | |||
| |-- 20_bitpanel_poweron -> ../bitlair_open.d/20_bitpanel_poweron | |||
| |-- 20_lounge_leds_poweron -> /opt/spacestate/bitlair_open.d/20_lounge_leds_poweron | |||
| |-- 20_music_poweron -> ../bitlair_open.d/20_music_poweron | |||
| |-- 21_ledbanner_on -> /opt/spacestate/bitlair_open.d/21_ledbanner_on | |||
| |-- 22_phone_on -> /opt/spacestate/bitlair_open.d/22_phone_on | |||
| |-- 22_statsbak_on -> /opt/spacestate/bitlair_open.d/22_statsbak_on | |||
| `-- 80_irc | |||
|-- README.md | |||
|-- spacestated | |||
`-- spacestated.service | |||
</pre> | |||
=== Twitter === | |||
Gebruik <code>bitlair-tweet <message></code> in /usr/local/bin om een bericht over Twitter te sturen. | |||
De gebruiker moet hiervoor in de twitter groep zitten. | |||
=== POE, APC en POWERBAR === | |||
* POE = HP ProCurve 3500 switch --> schakel PoE aan/uit op specifieke poorten | |||
* APC = APC powerbar in het serverrack --> schakel specifieke outlets | |||
* POWERBAR = Powerbar in de space (boven systeemplafon), via Moxa serial to ethernet --> schakele specifieke outlets | |||
Gebruik <code>apc-switch</code>, <code>poe-switch</code> of <code>powerbar-switch</code> in /usr/local/bin om POE, APC en POWERBAR switches te bedienen vanuit scripts. | |||
=== IRC === | |||
JSON-bot is vervangen door een Bash script. Gebruik <code>irc-say</code> om een notice in #bitlair te gooien. | |||
* Code: https://github.com/bitlair/irc-bot | |||
=== Space API === | |||
De statejson is nu een Python script die de open status uit MQTT haalt. | |||
* Code: https://github.com/bitlair/spaceapi | |||
=== Alarm === | |||
NOTE: op Bitlair3 is het alarm nog niet actief; onderstaande informatie is van Bitlair2 | |||
De spacestate en jsonbot hook zijn uit siahsd verwijderd en vervangen door een hook die een script uit voert voor ieder binnenkomend event ipv alleen open en close. | |||
Het script gooit een melding op IRC en voert run-parts uit. | |||
* Code (siahsd): https://github.com/bitlair/siahsd | |||
<pre> | |||
root@service:/opt/alarm# tree | |||
. | |||
├── armed.d | |||
│ ├── 10_log | │ ├── 10_log | ||
│ ├── 10_mqtt | │ ├── 10_mqtt | ||
│ ├── | │ ├── 20_48switch | ||
│ └── 20_statefile | |||
├── disarmed.d | |||
│ └── | |||
├── | |||
│ ├── 10_log | │ ├── 10_log | ||
│ ├── 10_mqtt | │ ├── 10_mqtt | ||
│ ├── | │ ├── 20_48switch | ||
│ └── 20_statefile | |||
└── siahsd_handler.sh | |||
│ └── | |||
</pre> | </pre> | ||
Latest revision as of 22:40, 8 February 2018
Project Spacestate | |
---|---|
Name | Spacestate |
Start | 2016/09/19 |
End | |
Contact | Polyfloyd, AK47 |
Website | |
Information | Opvolger van SpaceNotifier |
Status | Production |
TODO & Issues
-> https://git.bitlair.nl/bitlair/infra/issues
Systeem
Spacestate
root@service:/opt/spacestate# tree . |-- bitlair_closed.d | |-- 10_log | |-- 10_mqtt | |-- 20_music_poweroff | |-- 21_bitpanel_poweroff | |-- 21_lounge_leds_poweroff | |-- 22_bank_off | |-- 22_phone_off | |-- 23_ledbanner_off | |-- 24_statsbank_off | |-- 80_irc | `-- 80_twitter |-- bitlair_open.d | |-- 10_log | |-- 10_mqtt | |-- 20_bank_on | |-- 20_bitpanel_poweron | |-- 20_lounge_leds_poweron | |-- 20_music_poweron | |-- 21_ledbanner_on | |-- 22_phone_on | |-- 22_statsbak_on | |-- 80_irc | `-- 80_twitter |-- djo_closed.d | |-- 10_mqtt | |-- 20_music_poweroff -> ../bitlair_closed.d/20_music_poweroff | |-- 21_bitpanel_poweroff -> ../bitlair_closed.d/21_bitpanel_poweroff | |-- 21_lounge_leds_poweroff -> /opt/spacestate/bitlair_closed.d/21_lounge_leds_poweroff | |-- 22_bank_off -> /opt/spacestate/bitlair_closed.d/22_bank_off | |-- 22_phone_off -> /opt/spacestate/bitlair_closed.d/22_phone_off | |-- 23_ledbanner_off -> /opt/spacestate/bitlair_closed.d/23_ledbanner_off | |-- 24_statsbak_off -> /opt/spacestate/bitlair_closed.d/24_statsbank_off | `-- 80_irc |-- djo_open.d | |-- 10_mqtt | |-- 20_bank_on -> /opt/spacestate/bitlair_open.d/20_bank_on | |-- 20_bitpanel_poweron -> ../bitlair_open.d/20_bitpanel_poweron | |-- 20_lounge_leds_poweron -> /opt/spacestate/bitlair_open.d/20_lounge_leds_poweron | |-- 20_music_poweron -> ../bitlair_open.d/20_music_poweron | |-- 21_ledbanner_on -> /opt/spacestate/bitlair_open.d/21_ledbanner_on | |-- 22_phone_on -> /opt/spacestate/bitlair_open.d/22_phone_on | |-- 22_statsbak_on -> /opt/spacestate/bitlair_open.d/22_statsbak_on | `-- 80_irc |-- README.md |-- spacestated `-- spacestated.service
Gebruik bitlair-tweet <message>
in /usr/local/bin om een bericht over Twitter te sturen.
De gebruiker moet hiervoor in de twitter groep zitten.
POE, APC en POWERBAR
- POE = HP ProCurve 3500 switch --> schakel PoE aan/uit op specifieke poorten
- APC = APC powerbar in het serverrack --> schakel specifieke outlets
- POWERBAR = Powerbar in de space (boven systeemplafon), via Moxa serial to ethernet --> schakele specifieke outlets
Gebruik apc-switch
, poe-switch
of powerbar-switch
in /usr/local/bin om POE, APC en POWERBAR switches te bedienen vanuit scripts.
IRC
JSON-bot is vervangen door een Bash script. Gebruik irc-say
om een notice in #bitlair te gooien.
Space API
De statejson is nu een Python script die de open status uit MQTT haalt.
Alarm
NOTE: op Bitlair3 is het alarm nog niet actief; onderstaande informatie is van Bitlair2
De spacestate en jsonbot hook zijn uit siahsd verwijderd en vervangen door een hook die een script uit voert voor ieder binnenkomend event ipv alleen open en close. Het script gooit een melding op IRC en voert run-parts uit.
- Code (siahsd): https://github.com/bitlair/siahsd
root@service:/opt/alarm# tree . ├── armed.d │ ├── 10_log │ ├── 10_mqtt │ ├── 20_48switch │ └── 20_statefile ├── disarmed.d │ ├── 10_log │ ├── 10_mqtt │ ├── 20_48switch │ └── 20_statefile └── siahsd_handler.sh