Show last authors
1 {{content/}}
2
3 == Available monitoring beans ==
4
5 For monitoring the current status of the server, {{formcycle/}} provides a monitoring bean for each server type. It can be accessed and read via JMX by using tools such as for example //JConsole//.
6
7 The beans are registered under the following names:
8
9 ; Frontend-Server
10 : de.xima.fc:type=FSMonitor,qualifier=<contextName>
11 ; Master-Server
12 : de.xima.fc:type=MSMonitor,qualifier=<contextName>
13
14 The context name is the context name of the applications. It is necessary for supporting parallel installations of {{formcycle/}} on a server. By default, the context name is the name of {{formcycle/}}'s WAR file, but it can be changed by modifying the context name parameter //XFC_CONTEXT_NAME// within the //web.xml//.
15
16 When starting the server, the current context name is logged. You may need to modify the [[logging settings>>doc:.UserInterface.Logging]] to see the name. There are different monitoring attributes available for each bean, which are listed below.
17
18 {{table dataTypeAlpha="0" preSort="0-asc" caption="Overview of the settings for MSMonitor (master server)"}}
19 |=Attribute|=Description|=Possible options
20 |running|Whether the {{mserver/}} has been started successfully.|true/false
21 |db_connected|Whether the {{mserver/}} could establish a connection to the database.|true/false
22 |fs_connected|A map of the names of all {{fserver number="plural"/}} and whether they are connected to this master server|__Key:__ <serverName>
23 __Return value:__ true/false
24 |fs_active|A map of the names of all {{fserver number="plural"/}} and whether this master server should attempt to establish a connection to that server automatically.|__Key:__ <serverName>
25 __Return value:__ true/false
26 |fs_status|A map of the names of all {{fserver number="plural"/}} and the connection status of that server.|__Key:__ <serverName>
27 __Return values:__ CONNECTED, NOT_CONNECTED, ERROR, RECONNECTING, DISCONNECTING , CONNECTING, AUTHENTICATING, WAIT_FOR_CONNECTION
28 |fs_disconnected_count|The number of {{fserver number="plural"/}} not connected to this {{mserver/}}|A non-negative number
29 |fs_connected_count|The number of {{fserver number="plural"/}} connected to this {{mserver/}}|A non-negative number
30 |failed_login_count|For each login name, the login cache contains how many times a user made a failed login attempt with that login name. This is the number of login names in that cache.|A non-negative number
31 |connect_frontendserver_by_name|Triggers a connection to the frontend server by name.|__Key:__ <serverName>, true/false to trigger reconnect always (no matter if there is a connection)
32 __Return value:__ true/false
33 |connect_frontendserver_by_id|Triggers a connection to the frontend server by id.|__Key:__ <serverName>, true/false to trigger reconnect always (no matter if there is a connection)
34 __Return value:__ true/false
35 {{/table}}
36
37 {{table dataTypeAlpha="0" preSort="0-asc" caption="Overview of the settings for FSMonitor (frontend server)"}}
38 |=Attribute|=Description|=Possible options
39 |running|Whether the {{fserver/}} has been started successfully.|true/false
40 |connected|Whether this {{fserver/}} is connected to a {{mserver/}}.|true/false
41 |failed_login_count|For each login name, the login cache contains how many times a user made a failed login attempt with that login name. This is the number of login names in that cache.|A non-negative number
42 |status|The connection status of this {{fserver/}}.|CONNECTED, NOT_CONNECTED, ERROR, RECONNECTING, DISCONNECTING, CONNECTING, AUTHENTICATING, WAIT_FOR_CONNECTION
43 |restart|Triggers a restart of the frontend server.|None
44 {{/table}}
45
46 == JSON REST API ==
47
48 The JSON interface has been removed since version 6.0.0 in favor of a separate Jolokia installation. The beans used for monitoring are still available. The JSON interface of the monitoring allowed read-only access and could only be called via the application server (localhost/127.0.0.1). If this is wanted, the access would have to be configured within the Jolokia application, more information can be found [[here>>https://jolokia.org/reference/html/security.html#d0e3128||rel="noopener noreferrer" target="_blank"]].
49
50 A possible call, after installation of Jolokia, looks like the following:
51
52 {{info}}
53 [[http:~~/~~/localhost/jolokia/read/de.xima.fc:type=MSMonitor,qualifier=formcycle>>http://localhost/jolokia/read/de.xima.fc:type=MSMonitor,qualifier=formcycle]]
54 {{/info}}
55
56 (% class="wikigeneratedid" id="HJSONresponse" %)
57 JSON response:
58
59 {{code language="JSON"}}
60 {
61 "request": {
62 "mbean": "de.xima.fc:qualifier=formcycle,type=MSMonitor",
63 "type": "read"
64 },
65 "value": {
66 "running": true,
67 "failed_login_count": 0,
68 "fs_active": {
69 "localhost": true
70 },
71 "db_connected": true,
72 "fs_connected_count": 1,
73 "fs_connected": {
74 "localhost": true
75 },
76 "fs_disconnected_count": 0,
77 "fs_status": {
78 "localhost": "CONNECTED"
79 }
80 },
81 "timestamp": 1579186291,
82 "status": 200
83 }
84 {{/code}}
85
86 (% class="wikigeneratedid" %)
87 More information about the integration of the framework [[Jolokia>>url:https://jolokia.org/||rel="__blank"]] and a more detailed documentation can be found [[here>>https://jolokia.org/reference/html/||rel="noopener noreferrer" target="_blank"]].
88
89 == Nagios integration ==
90
91 The Nagios monitoring application may be used for reading and showing monitoring info as well by using the JSON REST API described above. This requires the Nagios plugin [[jmx4perl>>url:http://search.cpan.org/~~roland/jmx4perl/||rel="__blank"]] to be installed. A detailed installation instruction can be found on [[their website>>url:https://jolokia.org/tutorial.html||rel="__blank"]]. This allows querying the JSON REST API with the corresponding commands.
92
93 === Examples ===
94
95 {{info}}
96 These examples assume that Nagios is installed on the the same server as the {{formcycle/}} application(s).
97 {{/info}}
98
99 {{panel title="Command" fullwidth="true" initial="hidden" triggerable="true"}}
100 {{code language="none"}}
101 define command{
102 command_name check_jmx4perl
103 command_line check_jmx4perl --url $ARG1$ --mbean $ARG2$ --attribute $ARG3$ $ARG4$
104 }
105 {{/code}}
106 {{/panel}}
107
108 {{panel title="Service definitions" fullwidth="true" initial="hidden" triggerable="true"}}
109 Querying the number of {{fserver number="plurar"/}} not connected to this {{mserver/}}. When there are any disconnected servers, a warning will be displayed. When there is more than one disconnected server, Nagios will treat this warning as critical.<br>
110 <br>
111 {{code language="none"}}
112 define service{
113 use generic-service
114 host_name localhost
115 service_description MS:FS-connected-count
116 check_command check_jmx4perl!http://localhost/formcycle/monitoring/!de.xima.fc:type=MSMonitor,qualifier=formcycle!fs_disconnected_count!--warning 1 --critical 2
117 }
118 {{/code}}
119 {{/panel}}
120
121 {{panel title="Querying the database connection status of the {{mserver/~}~}" fullwidth="true" initial="hidden" triggerable="true"}}
122 {{code language="none"}}
123 define service{
124 use generic-service
125 host_name localhost
126 service_description MS:DB-connected
127 check_command check_jmx4perl!http://localhost/formcycle/monitoring/!de.xima.fc:type=MSMonitor,qualifier=formcycle!db_connected!--string --critical 'false'
128 }
129 {{/code}}
130 {{/panel}}
131
132 {{panel title="Querying whether the {{fserver/~}~} localhost is connected to the {{mserver/~}~}" fullwidth="true" initial="hidden" triggerable="true"}}
133 {{code language="none"}}
134 define service{
135 use generic-service
136 host_name localhost
137 service_description MS:FS-localhost
138 check_command check_jmx4perl!http://localhost/formcycle/monitoring/!de.xima.fc:type=MSMonitor,qualifier=formcycle!fs_connected!--path=localhost --string --critical 'false'
139 }
140 {{/code}}
141 {{/panel}}
142
143 {{panel title="Querying the {{fserver/~}~} whether it is connected to a {{mserver/~}~}" fullwidth="true" initial="hidden" triggerable="true"}}
144 {{code language="none"}}
145 define service{
146 use generic-service
147 host_name localhost
148 service_description FS:connected
149 check_command check_jmx4perl!http://localhost/frontend-server/monitoring/!de.xima.fc:type=FSMonitor,qualifier=frontend-server!connected!--string --critical 'false'
150 }
151 {{/code}}
152 {{/panel}}
153
154 === Running Nagios on a different server ===
155
156 For security concerns, the JSON REST API does not allow querying the monitoring info from other IP addresses, only from the local server. Running Nagios on a different server and querying the monitoring info is still possible, but requires some additional setup.
157
158 One option is to setup the routing accordingly or using a proxy.
159
160 Another options for using Nagios on a different server is by providing certain options to the monitoring servlet. The parameter //policyLocation// provides the servlet with the URL to a Jolokia policy file, which will be passed on to Jolokia. The monitoring servlet is an extends Jolokia standard servlet and all Jolokia-specific parameters can be used. A list of relevant parameters can be found [[website>>url:https://jolokia.org/reference/html/agents.html#agent-war-init-params||rel="__blank"]].
161
162 A third option is running Jolokia in parallel to {{formcycle/}} or the {{fserver/}}. Jolokia provides an application with a Java-EE agent for this purpose, [[documentation>>url:https://jolokia.org/reference/html/agents.html#agents-war||rel="__blank"]] and [[download>>url:https://jolokia.org/download.html||rel="__blank"]]).
163
164 This agent does not possess any restrictions for read operations or control commands. However, as this represents a potential security issue, we strongly recommend to configure this agent for the server and network settings in use and restrict access as much as possible. For example, access should be restricted to the server running the Nagios application.
165
166 Jolokia provides more details on security-related options [[in their documentation>>url:https://jolokia.org/reference/html/security.html||rel="__blank"]].
167
168 When Jolokia is run parallel to {{formcycle/}}, the connection to the {{fserver/}} //localhost// must be modified as follows:
169
170 {{code language="none"}}
171 define service{
172 use generic-service
173 host_name fc-test
174 service_description MS:FS-localhost
175 check_command check_jmx4perl!http://fc-test/jolokia/!de.xima.fc:type=MSMonitor,qualifier=formcycle!fs_connected!--path=localhost --string --critical 'false'
176 }
177 {{/code}}
Copyright 2000-2024