2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 09:13:08 +00:00

Remove trailing spaces in file xCAT-server/lib/xcat/monitoring/monitorctrl.pm

This commit is contained in:
GONG Jie 2017-12-31 23:59:59 +00:00
parent e7ea9e7b8b
commit c60c5cebca

View File

@ -39,7 +39,7 @@ my $masterpid;
=head2 Package Description
xCAT monitoring control module. This module is the center for the xCAT
monitoring support. It interacts with xctad and the monitoring plug-in modules
for the 3rd party monitoring products.
for the 3rd party monitoring products.
=cut
#-------------------------------------------------------------------------------
@ -51,7 +51,7 @@ my $masterpid;
=head3 start
It is called by the xcatd when xcatd gets started.
It gets a list of monitoring plugin module names from the "monitoring"
It gets a list of monitoring plugin module names from the "monitoring"
table. It gets a list of nodes in the xcat cluster and,
in tern, calls the start() function of all the monitoring
plug-in modules. It registers for nodelist
@ -146,13 +146,13 @@ sub start {
#--------------------------------------------------------------------------------
=head3 stop
It is called by the xcatd when xcatd stops. It
It is called by the xcatd when xcatd stops. It
in tern calls the stop() function of each monitoring
plug-in modules, stops all the timers for pulling the
node status and unregisters for the nodelist
tables changes.
node status and unregisters for the nodelist
tables changes.
Arguments:
configLocal -- 1 means that only the local node get configured.
configLocal -- 1 means that only the local node get configured.
Returns:
0 for successful.
non-0 for not successful.
@ -214,17 +214,17 @@ sub sendMonSignal {
It takes a list of monitoring plug-in names as an input and start
the monitoring process for them.
Arguments:
names -- a pointer to an array of monitoring plug-in module names to be started.
If non is specified, all the plug-in modules registered in the monitoring
table will be used.
names -- a pointer to an array of monitoring plug-in module names to be started.
If non is specified, all the plug-in modules registered in the monitoring
table will be used.
p_nodes -- a pointer to an arrays of nodes to be monitored. null means all.
scope -- the action scope, it indicates the node type the action will take place.
0 means local host only.
2 means both local host and nodes,
0 means local host only.
2 means both local host and nodes,
callback -- the callback pointer for error and status displaying. It can be null.
grands -- a hash pointer. key: "servicenode,xcatmaset", value: a array pointer of grand children nodes. This one is only set when the current node is mn and handleGrandChildren returns 1 by the monitoring plugin.
Returns:
A hash table keyed by the plug-in names. The value is an array pointer
A hash table keyed by the plug-in names. The value is an array pointer
pointer to a return code and message pair. For example:
{rmcmon=>[0, ""], gangliamin=>[1, "something is wrong"]}
@ -280,7 +280,7 @@ sub startMonitoring {
#--------------------------------------------------------------------------------
=head3 startNodeStatusMonitoring
It starts the given plug-in for node status monitoring.
It starts the given plug-in for node status monitoring.
If no product is specified, use the one in the monitoring table.
Arguments:
name -- name of the mornitoring plug-in module to be started for node status monitoring.
@ -288,8 +288,8 @@ sub startMonitoring {
"nodestatmon" column set to be "1", or "Yes".
p_nodes -- a pointer to an arrays of nodes to be monitored. null means all.
scope -- the action scope, it indicates the node type the action will take place.
0 means local host only.
2 means both local host and nodes,
0 means local host only.
2 means both local host and nodes,
callback -- the callback pointer for error and status displaying. It can be null.
grands -- a hash pointer. key: "servicenode,xcatmaset", value: a array pointer of grand children nodes. This one is only set when the current node is mn and handleGrandChildren returns 1 by the monitoring plugin.
Returns:
@ -356,8 +356,8 @@ sub startNodeStatusMonitoring {
all the plug-ins registered in the monitoring table will be stopped.
p_nodes -- a pointer to an arrays of nodes to be stopped for monitoring. none means all.
scope -- the action scope, it indicates the node type the action will take place.
0 means local host only.
2 means both local host and nodes,
0 means local host only.
2 means both local host and nodes,
callback -- the callback pointer for error and status displaying. It can be null.
grands -- a hash pointer. key: "servicenode,xcatmaset", value: a array pointer of grand children nodes. This one is only set when the current node is mn and handleGrandChildren returns 1 by the monitoring plugin.
Returns:
@ -434,7 +434,7 @@ sub stopMonitoring {
#--------------------------------------------------------------------------------
=head3 stopNodeStatusMonitoring
It stops the given plug-in for node status monitoring.
It stops the given plug-in for node status monitoring.
If no plug-in is specified, use the one in the monitoring table.
Arguments:
name -- name of the monitoring plu-in module to be stopped for node status monitoring.
@ -442,8 +442,8 @@ sub stopMonitoring {
"nodestatmon" column set to be "1", or "Yes".
p_nodes -- a pointer to an arrays of nodes to be stopped for monitoring. null means all.
scope -- the action scope, it indicates the node type the action will take place.
0 means local host only.
2 means both local host and nodes,
0 means local host only.
2 means both local host and nodes,
callback -- the callback pointer for error and status displaying. It can be null.
grands -- a hash pointer. key: "servicenode,xcatmaset", value: a array pointer of grand children nodes. This one is only set when the current node is mn and handleGrandChildren returns 1 by the monitoring plugin.
Returns:
@ -500,7 +500,7 @@ sub stopNodeStatusMonitoring {
It is called when the monitoring table gets changed.
When a plug-in is added to or removed from the monitoring table, this
function will start the plug-in to monitor the xCAT cluster or stop the plug-in
from monitoring the xCAT cluster accordingly.
from monitoring the xCAT cluster accordingly.
Arguments:
See processTableChanges.
Returns:
@ -620,12 +620,12 @@ sub getNodeStatusFromNodesetState {
#--------------------------------------------------------------------------------
=head3 setNodeStatusAttributes
This routine will be called by
This routine will be called by
monitoring plug-in modules to feed the node status back to xcat.
(callback mode). This function will update the status column of the
nodelist table with the new node status.
Arguments:
status -- a hash pointer of the node status. A key is a status string. The value is
status -- a hash pointer of the node status. A key is a status string. The value is
an array pointer of nodes that have the same status.
for example: {alive=>["node1", "node1"], unreachable=>["node5","node100"]}
force -- 1 force the input values to be set.
@ -738,7 +738,7 @@ sub setNodeStatusAttributes {
Arguments:
none.
Returns:
a hash that has the node status. The format is:
a hash that has the node status. The format is:
{alive=>[node1, node3,...], unreachable=>[node4, node2...], unknown=>[node8, node101...]}
=cut
@ -773,11 +773,11 @@ sub getNodeStatus {
#--------------------------------------------------------------------------------
=head3 refreshProductList
This function goes to the monitoring table to get the plug-in names
This function goes to the monitoring table to get the plug-in names
and stores the value into the PRODUCT_LIST cache. The cache also stores
the monitoring plugin module name and file name for each plug-in. This function
also load the modules in.
also load the modules in.
Arguments:
none
Returns:
@ -841,10 +841,10 @@ sub refreshProductList {
=head3 getPluginSettings
This function goes to the monsetting table to get the settings for a given
monitoring plug-in.
monitoring plug-in.
Arguments:
name the name of the monitoring plug-in module. such as snmpmon, rmcmon etc.
name the name of the monitoring plug-in module. such as snmpmon, rmcmon etc.
Returns:
A hash table containing the key and values of the settings.
=cut
@ -887,8 +887,8 @@ sub getPluginSettings {
=head3 isMonServer
Determines if the local host is a monitoring server.
Arguments:
none.
Returns:
none.
Returns:
1 if the local host is a moniterring server.
0 if the local host is not a monitotering server.
=cut
@ -918,21 +918,21 @@ sub isMonServer {
=head3 getNodeMonServerPair
It gets the monserver and monmaster for the given nodes.
Arguments:
$nodes a pointer to an array of nodes. If the array is empty, all nodes in the
$nodes a pointer to an array of nodes. If the array is empty, all nodes in the
nodelist table will be used.
retfromat 0-- A pointer to a hash table with node as the key and a the monserver pairs
string as the value.
string as the value.
For example: { node1=>"sv1:ma1", node2=>"sv2:ma2", node3=>"sv2:ma2"...}
1-- A pointer to a hash table with monserver pairs as the key and an array
pointer of nodes as the value.
pointer of nodes as the value.
For example: { "sv1:ma1"=>[node1,node2], "sv2:ma2"=>node3...}
The pair is in the format of "monserver,monmaser". First one is the monitoring service
node ip/hostname that faces the mn and the second one is the monitoring service
node ip/hostname that faces the cn.
The value of the first one can be "noservicenode" meaning that there is no service node
for that node. In this case the second one is the site master.
Returns:
The pair is in the format of "monserver,monmaser". First one is the monitoring service
node ip/hostname that faces the mn and the second one is the monitoring service
node ip/hostname that faces the cn.
The value of the first one can be "noservicenode" meaning that there is no service node
for that node. In this case the second one is the site master.
Returns:
An pointer to a hash.
It retuens a pointer to an array if there is an error. Format is [code, message].
=cut
@ -1019,11 +1019,11 @@ sub getNodeMonServerPair {
Returns:
A hash reference keyed by the monitoring server nodes and each value is a ref to
an array of [nodes, nodetype, status] arrays monitored by the server. So the format is:
{monserver1=>[['node1', 'osi', 'alive'], ['node2', 'switch', 'booting']...], ...}
A key is a pair of hostnames with the first one being the service node ip/hostname
that faces the mn and the second one being the service node ip/hostname that faces the cn.
The value of the first one can be "noservicenode" meaning that there is no service node
for that node. In this case the second one is the site master.
{monserver1=>[['node1', 'osi', 'alive'], ['node2', 'switch', 'booting']...], ...}
A key is a pair of hostnames with the first one being the service node ip/hostname
that faces the mn and the second one being the service node ip/hostname that faces the cn.
The value of the first one can be "noservicenode" meaning that there is no service node
for that node. In this case the second one is the site master.
It returns a pointer to an array if there is an error. Format is [code, message].
=cut
@ -1113,23 +1113,23 @@ sub getMonHierarchy {
#--------------------------------------------------------------------------------
=head3 getMonServerWithInfo
It gets the monnitoring server node for each of the nodes from the input.
It gets the monnitoring server node for each of the nodes from the input.
The "monserver" attribute is used from the noderes table. If "monserver" is not defined
for a node, "servicenode" is used. If none is defined, use the local host as the
the monitoring server. The difference of this function from the getMonServer function
is that the input of the nodes have 'node' and 'status' info.
is that the input of the nodes have 'node' and 'status' info.
The other one just has 'node'. The
names.
names.
Arguments:
nodes: An array ref. Each element is of the format: [node, status]
Returns:
A hash reference keyed by the monitoring server nodes and each value is a ref to
an array of [nodes, nodetype, status] arrays monitored by the server. So the format is:
{monserver1=>[['node1', 'osi', 'alive'], ['node2', 'switch', 'booting']...], ...}
A key is pair of hostnames with the first one being the service node ip/hostname
that faces the mn and the second one being the service node ip/hostname that faces the cn.
The value of the first one can be "noservicenode" meaning that there is no service node
for that node. In this case the second one is the site master.
{monserver1=>[['node1', 'osi', 'alive'], ['node2', 'switch', 'booting']...], ...}
A key is pair of hostnames with the first one being the service node ip/hostname
that faces the mn and the second one being the service node ip/hostname that faces the cn.
The value of the first one can be "noservicenode" meaning that there is no service node
for that node. In this case the second one is the site master.
It retuens a pointer to an array if there is an error. Format is [code, message].
=cut
@ -1196,11 +1196,11 @@ sub getMonServerWithInfo {
Returns:
A hash reference keyed by the monitoring server nodes and each value is a ref to
an array of [nodes, nodetype, status] arrays monitored by the server. So the format is:
{monserver1=>[['node1', 'osi', 'alive'], ['node2', 'switch', 'booting']...], ...}
A key is a pair of hostnames with the first one being the service node ip/hostname
that faces the mn and the second one being the service node ip/hostname that faces the cn.
The value of the first one can be "noservicenode" meaning that there is no service node
for that node. In this case the second one is the site master.
{monserver1=>[['node1', 'osi', 'alive'], ['node2', 'switch', 'booting']...], ...}
A key is a pair of hostnames with the first one being the service node ip/hostname
that faces the mn and the second one being the service node ip/hostname that faces the cn.
The value of the first one can be "noservicenode" meaning that there is no service node
for that node. In this case the second one is the site master.
It retuens a pointer to an array if there is an error. Format is [code, message].
=cut
@ -1267,7 +1267,7 @@ sub getMonServer {
=head3 nodeStatMonName
This function returns the current monitoring plug-in name that is assigned for monitroing
the node status for xCAT cluster.
the node status for xCAT cluster.
Arguments:
none
Returns:
@ -1283,7 +1283,7 @@ sub nodeStatMonName {
#--------------------------------------------------------------------------------
=head3 getAllRegs
This function gets all the registered monitoring plug-ins.
This function gets all the registered monitoring plug-ins.
Arguments:
none
Returns:
@ -1325,18 +1325,18 @@ sub getAllRegs
#--------------------------------------------------------------------------------
=head3 config
This function configures the cluster for the given nodes.
This function configures the cluster for the given nodes.
Arguments:
names -- a pointer to an array of monitoring plug-in names. If non is specified,
all the plug-ins registered in the monitoring table will be notified.
p_nodes -- a pointer to an arrays of nodes to be added for monitoring. none means all.
scope -- the action scope, it indicates the node type the action will take place.
0 means local host only.
2 means both local host and nodes,
0 means local host only.
2 means both local host and nodes,
callback -- the callback pointer for error and status displaying. It can be null.
grands -- a hash pointer. key: "servicenode,xcatmaset", value: a array pointer of grand children nodes. This one is only set when the current node is mn and handleGrandChildren returns 1 by the monitoring plugin.
Returns:
ret a hash with plug-in name as the keys and the an arry of
ret a hash with plug-in name as the keys and the an arry of
[return code, error message] as the values.
=cut
@ -1391,20 +1391,20 @@ sub config {
#--------------------------------------------------------------------------------
=head3 deconfig
This function de-configures the cluster for the given nodes.
It function informs all the local active monitoring plug-ins to
remove the given nodes to their monitoring domain.
This function de-configures the cluster for the given nodes.
It function informs all the local active monitoring plug-ins to
remove the given nodes to their monitoring domain.
Arguments:
names -- a pointer to an array of monitoring plug-in names. If non is specified,
all the plug-ins registered in the monitoring table will be notified.
p_nodes -- a pointer to an arrays of nodes to be removed for monitoring. none means all.
scope -- the action scope, it indicates the node type the action will take place.
0 means local host only.
2 means both loca lhost and nodes,
0 means local host only.
2 means both loca lhost and nodes,
callback -- the callback pointer for error and status displaying. It can be null.
grands -- a hash pointer. key: "servicenode,xcatmaset", value: a array pointer of grand children nodes. This one is only set when the current node is mn and handleGrandChildren returns 1 by the monitoring plugin.
Returns:
ret a hash with plug-in name as the keys and the an arry of
ret a hash with plug-in name as the keys and the an arry of
[return code, error message] as the values.
=cut
@ -1462,11 +1462,11 @@ sub deconfig {
=head3 getNodeConfData
This function goes to every monitoring plug-in module and returns a list of
configuration data that is needed by setting up node monitoring.
These data-value pairs will be used as environmental variables
configuration data that is needed by setting up node monitoring.
These data-value pairs will be used as environmental variables
on the given node.
Arguments:
noderef -- a pointer to an array of nodes.
noderef -- a pointer to an array of nodes.
Returns:
ret: pointer to a 2-level hash like this:
{
@ -1475,9 +1475,9 @@ sub deconfig {
'node2'=>{'env1'=>'value3',
'env2'=>'value4'}
}
or a pointer to array if there is an error. [error code, error message]
=cut
#--------------------------------------------------------------------------------
@ -1556,12 +1556,12 @@ sub getNodeConfData {
#--------------------------------------------------------------------------------
=head3 show
This function show performance for the given nodes.
This function show performance for the given nodes.
Arguments:
names -- a pointer to an array of monitoring plug-in names. If non is specified,
all the plug-ins registered in the monitoring table will be notified.
p_nodes -- a pointer to an arrays of nodes to be added for monitoring. none means all.
sum --
sum --
0 indicates to show performance of specified node.
1 indicates to show sum of performance of one or more management domain which managed by node specified in the noderange.
2 means to show performance of specified node and MN.
@ -1571,7 +1571,7 @@ sub getNodeConfData {
pe -- TODO;
callback -- the callback pointer for error and status displaying. It can be null.
Returns:
ret a hash with plug-in name as the keys and the an arry of
ret a hash with plug-in name as the keys and the an arry of
[return code, error message] as the values.
=cut