File: DEVEL

package info (click to toggle)
cpqarrayd 2.3.6
  • links: PTS
  • area: main
  • in suites: buster
  • size: 700 kB
  • sloc: sh: 7,053; ansic: 1,042; makefile: 84
file content (41 lines) | stat: -rw-r--r-- 1,131 bytes parent folder | download | duplicates (5)
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
CpqArray Daemon
----------------

developer scratch pad

idea: 
create a daemon that monitors the smartarray controller and sends alerts on events. It should also allow a remote admin to retrieve info on the status remotely by using the array-tool.

design:

a part takes care of monitoring the controller.
a part takes care of sending alerts to everybody who wants to listen.
  syslog & snmptraps preferably.
a part takes care of remote requests and processes them.


remote part:
struct message {
     _u8 version;
     _u8 opcode;
     _u32 datalength;
}
followed by datalength amount of data..

open socket in listening mode
when connected pass the socket to the handler code
and open a new listening socket..
(sounds like taking good care of locks of the devices e.g.)

program


fork the program to the background unless in debugmode.
init everything that needs to be inited.
spawn task to handle the client/server part
mainloop
  check the status of all controllers in the system.
  if status change found send snmptrap (or spawn task to send trap)
end mainloop (KILL, remote command)
kill the socket task
close everything.