1FENCE_NA(8) User Contributed Perl Documentation FENCE_NA(8)
2
3
4
6 fence_na
7
8 This is the fence agent for the Node Assassin fence device.
9
11 fence_na -a fence_na01.domain.com -n 2 -l admin -p secret -o off
12
14 This fence agent takes argument from the command line or from the
15 'fenced' program and interprets them into calls to send to the Node
16 Assassin fence device. It analyzes the returned information and exits
17 with an appropriate exit code as dictated by the FenceAgentAPI.
18
20 Arguments are read from STDIN as 'variable=value' pairs, one pair per
21 new line. This is the method used by 'fenced'.
22
23 For testing or manual control, arguments may be passed as command line
24 arguments.
25
27 This takes arguments that defined which Node Assassin to call, what
28 node to work on and what action should be taken. These arguments are
29 defined by the FenceAgentAPI. These actions are then translated into a
30 set of Node Assassin states which then get passed to the device.
31
33 The FenceAgentAPI refers to "ports" while the Node Assassin refers to
34 "nodes". These two terms are thus used interchangably. The reason for
35 the difference is that, internally, Node Assassin maps each node to
36 three "ports"; The node's power and reset buttons plus the node's power
37 feed.
38
39 Each node in the Node Assassin can be set to one of four states
40 described in the next section.
41
43 Each Node Assassin port can be set to one of four states. They are:
44
45 0
46 This will release the fence on the specified NA node's power and reset
47 ports.
48
49 1
50 This state will fence the node specified by the "port" argument. The
51 fence will remain active until released. Further, the fence will "lock
52 out" the node's front-panel buttons until the fence is released.
53
54 2
55 This will fence the node for one second. This is meant to provide a
56 mechanism to boot or initiate a clean shut down of a node.
57
58 3
59 This state will fence the node for five seconds to 30 seconds,
60 depending on how long it takes for the power feed to drop low. This is
61 meant to provide a way to force crashed nodes to power off without the
62 front-panel lock.
63
65 Which options are valid depends on how the arguments are passed in. The
66 "main" method of passing arguments is via STDIN as a series of
67 'varible=value' pairs, one per line. All arguments accepted this way
68 have command-line arguments passed in via single-dashes switches. Each
69 option below shows either calling method's arguments, where available.
70
71 "-h"
72 Prints this help message.
73
74 "-v", "-V"
75 Prints the version of this fence agent and then the version of any
76 configured, reachable Node Assassins.
77
78 "-q"
79 Tells this fence agent to only print critical messages.
80
81 "-d"
82 Tells this fence agent to print debug messages.
83
84 "-a address", "ipaddr=address"
85 Tells the fence agent which Node Assassin to use.
86
87 NOTE! The name or IP addresses *MUST* match a name or IP address
88 defined in "/etc/cluster/fence_na.conf"! Specifically, it must match
89 one of the "node::X::ipaddr" entries where "X" is the ID of the Node
90 Assassin.
91
92 "-l name", "login=name"
93 This is the login name used to connect to this fence agent. It must
94 match the value "system::username" in "/etc/cluster/fence_na.conf".
95
96 "-p secret", "passwd=secret"
97 This is the login password used to connect to this fence agent. It must
98 match the value "system::password" in "/etc/cluster/fence_na.conf".
99
100 "-n #", "port=#"
101 This tells the fence agent which node to act on.
102
103 NOTE! Please do not confuse this with the Node Assassin's internal
104 concept of a port.
105
106 "-o val", "action=val"
107 This is the "action" (formerly "option") to perform on the selected
108 node. Valid actions and how Node Assassin implements them are:
109
110 "off"
111
112 This set's the node to state 1; Fenced. Internally, it will hit the
113 reset switch for one second to immediately disable the node. Then it
114 will release the reset switch for another second before pressing and
115 holding the power switch. After five seconds, Node Assassin will check
116 the node's power feed. If it is still on, it will wait another 25
117 seconds and check again. If the node is still on, an error will be
118 generated. If the node turns off successfully, the fence is declared a
119 success. reboot
120
121 "on"
122
123 This sets the node to state '0'; Unfenced. Both the power and reset
124 switches are opened, the Node Assassin will pause for one second and
125 then the power switch will be closed for one second to boot the node
126 (that is, the node is set to "state 2").
127
128 "reboot"
129
130 Note: This will do a hard reboot! Do not use when a normal restart
131 would suffice.
132
133 This essetially just calls an "off" and then an "on". However, the
134 fence_na agent will return a success (exit 0) even if the "on" stage
135 succeeded. As per the FenceAgentAPI, a reboot does not need to
136 successfully boot the node to be concidered a success, it only needs to
137 shut it down.
138
139 "status"
140
141 This checks the power feed for the requested node is checked. If the
142 node is on, the agent will exit with code 0. If the node is off (or
143 disconnected), it will exit with code 1. If an error occurred calling
144 the Node Assassin, this will exit with code 2.
145
146 Note that this argument is designed to be used by the fence agent and
147 will not print any output to "STDOUT".
148
149 "monitor", "list"
150
151 Node Assassin Specific Actions
152 NOTE: The following states are supported by Node Assassin only. These
153 states are not used by the "fenced" daemon and are provided here as a
154 convenience for the user.
155
156 Any commands named *_all ignore the node value, if set.
157
158 "release"
159 If the node is fenced, the fence will be released. The difference from
160 "on" being that this will not boot the node after the fence is
161 released.
162
163 "release_all"
164 This does a "release" on all fenced nodes.
165
166 "fence_all"
167 All nodes are fenced. See the "off" state above.
168
169 "boot"
170 The power feed of the specific node on the Node Assassin is checked. If
171 it is found to be off, it will be set to state 2 to initiate boot.
172
173 "boot_all"
174 The power feeds of all nodes on the Node Assassin are checked. Any
175 found to be off are set to state 2 to initiate boot.
176
177 "shutdown"
178 The power feed of the specific node on the Node Assassin is checked. If
179 it is found to be on, it will be set to state 2 to initiate an ACPI-
180 induced soft shutdown.
181
182 "shutdown_all"
183 The power feeds of all nodes on the Node Assassin are checked. Any
184 found to be on are set to state 2 to initiate an ACPI-induced soft
185 shutdown.
186
187 "forcedown_all"
188 The power feeds of all nodes on the Node Assassin are checked. Any
189 found to be on are set to state 3. This state is similar to state 1
190 (see ""off"" above), except that the node's front-panel switches are
191 not disabled after the fence completes.
192
194 To simulate how 'fenced' calls the script, create a text file called
195 "args.txt" containing:
196
197 # Test file used as input for the NA fence agent.
198 ipaddr=fence_na01.domain.com
199 port=02
200 login=admin
201 passwd=secret
202 action=reboot
203
204 Now use "cat" to pipe the contents into the fence agent:
205
206 cat args.txt | fence_na
207
208 This will call the "off" function against node #02 connected to the
209 Node Assassin at "fence_na01.domain.com", fencing it. Change the
210 "action" line to "action=on" and re-run the script to release the fence
211 and boot the node.
212
213 To duplicate the same call using command line arguments:
214
215 fence_na -a fence_na01.domain.com -n 2 -l admin -p secret -o reboot
216
218 http://nodeassassin.org
219
221 Nov. 27, 2010
222
223 Digimer (digimer@alteeve.com)
224
225
226
227perl v5.12.4 2011-10-24 FENCE_NA(8)