-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlayout.txt
133 lines (106 loc) · 3.64 KB
/
layout.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
jabber bot
uses
- execute rundeck commands
- bot receives message to execute rundeck command
- ask permission (hunter & bryan)
- sanitize input
- send command to rundeck server
- bot recieves message to execute ssh command
- adhoc command through rundeck
- use rundeck to wrap "deck" of scripts files (sb_scripts, etc)
- query
- bot recieves message to query environment status
- uptime
- branch built on
- services running (tomcat, wrapper, etc)
- last build, last 10 builds
- alerts
- bot recieves message from non-user entity (service, trigger, etc)
- build success/fail
- environment is 100% for testing
- build params
- google calendar! (remind of a meeting (google cal api))
- speak
- bot returns data to SB pidgin server
- directed at user or channel
- end
- bot recieves term sig (with reason), shutdown gracefully (email admin rundeck shutdown w/ reason)
- bot recieves restart sig, restart (email admin rundeck restarted)
connection to jabber
listen mode - should pass task to speak, query, or execute mode
query mode - lookup, to.pretty,
speak mode - alert, return query data, return command execution details, return rundeck job details
execute mode
alert mode
kill/restart
bot.rb
======================================================
This module will serve as the UI for this
bot.
Execution:
ruby bot.rb start
- Imports all modules
- Create sustained connection ("Bot Alive")
- Call listen mode by default
- can accept params to pass info to other modules
- Receive Kill / Restart commands
- Kill connection
- Save state
- Restart script for Restart
connect.rb
======================================================
This module will serve as a connection proxy
for all the bot's functions. Should try attaching
to globals.conf for username and password in
an effort to keep credentials out of this project
Needs to:
- Make connection
- Destroy connection
- Check connection
- Load users/chat rooms
listen.rb
======================================================
This module will serve as the input center for users
to instruct the bot to execute an action or to request
information from the bot
Listening should lead to an action:
- Send to query.rb: find a thing out
- Send to exec.rb: do a thing
- Send to speak.rb: say a thing
- Send to alert.rb: inform user of a thing
speak.rb
======================================================
This module will serve as a method of outward
communication
This should connect and message either a user
or a chat room with information.
- Get info from query/exec
- Decide target audience
- Send message
- Return to listen mode
The information should arrive un-sanitized, so
sanitizing the outgoing message should depend
on where it's going
- All caps
- All lower
- Mix
exec.rb
======================================================
This module will serve as an executioner of
commands received from the listen module or
alert module
Should return stdout & stderr to speak module
- Receive parameters for execution
- Construct command based on params
- Set destination based on params
- Execute
- Return status or exit
alert.rb
======================================================
This module will serve as a signal processor that
alerts a user, users, or user entity of an event or
status. These can be expected alerts (rundeck finish),
or un-expected (rundeck fail using error handling).
Should work on integration with system calls & procs
to give live data on servers if errors happens
- Tie in to ELK / statsd / Graphite