mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-11-03 21:02:34 +00:00 
			
		
		
		
	remove the input parameters for start() and startNodeStatusMon() functions from the monitoring infrastructure. This is for performance because some plug-ins do not need the info.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@710 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		@@ -11,6 +11,7 @@ use Sys::Hostname;
 | 
			
		||||
use Socket;
 | 
			
		||||
use xCAT::Utils;
 | 
			
		||||
use xCAT::GlobalDef;
 | 
			
		||||
use xCAT_monitoring::monitorctrl;
 | 
			
		||||
 | 
			
		||||
#print "xCAT_monitoring::rmcmon loaded\n";
 | 
			
		||||
1;
 | 
			
		||||
@@ -44,10 +45,7 @@ use xCAT::GlobalDef;
 | 
			
		||||
      monitored by RMC are in sync with the nodes currently
 | 
			
		||||
      in the xCAT cluster.
 | 
			
		||||
    Arguments:
 | 
			
		||||
      monservers --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', 'active'], ['node2', 'switch', 'booting']...], ...}   
 | 
			
		||||
      None.
 | 
			
		||||
    Returns:
 | 
			
		||||
      (return code, message)      
 | 
			
		||||
=cut
 | 
			
		||||
@@ -55,13 +53,7 @@ use xCAT::GlobalDef;
 | 
			
		||||
sub start {
 | 
			
		||||
  print "rmcmon::start called\n";
 | 
			
		||||
 | 
			
		||||
  $noderef=shift;
 | 
			
		||||
  if ($noderef =~ /xCAT_monitoring::rmcmon/) {
 | 
			
		||||
    $noderef=shift;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  #TODO: get a list of monservers + nodes and compare them with RMC. remove/add 
 | 
			
		||||
  # if necessary. 
 | 
			
		||||
  my $noderef=xCAT_monitoring::monitorctrl->getMonHierarchy();
 | 
			
		||||
    
 | 
			
		||||
  #assume the server is the current node.
 | 
			
		||||
  #check if rsct is installed and running
 | 
			
		||||
@@ -237,10 +229,7 @@ sub supportNodeStatusMon {
 | 
			
		||||
    to monitor the node status changes.  
 | 
			
		||||
 | 
			
		||||
    Arguments:
 | 
			
		||||
      monservers --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', 'active'], ['node2', 'switch', 'booting']...], ...}   
 | 
			
		||||
       None.
 | 
			
		||||
    Returns:
 | 
			
		||||
        (return code, message)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -327,16 +327,6 @@ sub startMonitoring {
 | 
			
		||||
     @product_names=keys(%PRODUCT_LIST);    
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  my $monservers;
 | 
			
		||||
  if (@product_names > 0) {
 | 
			
		||||
    #get a list of monitoring servers and the nodes they are responsible for monitoring. 
 | 
			
		||||
    $monservers=getMonHierarchy();
 | 
			
		||||
    #foreach (keys(%$monservers)) {
 | 
			
		||||
    #  print "  monitoring server: $_\n";
 | 
			
		||||
    #  my $mon_nodes=$monservers->{$_};
 | 
			
		||||
    #  print "    nodes: @$mon_nodes\n";
 | 
			
		||||
    #}
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  my %ret=();
 | 
			
		||||
  foreach(@product_names) {
 | 
			
		||||
@@ -346,7 +336,7 @@ sub startMonitoring {
 | 
			
		||||
 | 
			
		||||
      undef $SIG{CHLD};
 | 
			
		||||
      #initialize and start monitoring
 | 
			
		||||
      my @ret1 = ${$module_name."::"}{start}->($monservers);
 | 
			
		||||
      my @ret1 = ${$module_name."::"}{start}->();
 | 
			
		||||
      $ret{$_}=\@ret1;
 | 
			
		||||
    } else {
 | 
			
		||||
       $ret{$_}=[1, "Monitoring plug-in module $_ is not registered."];
 | 
			
		||||
@@ -388,7 +378,7 @@ sub startNodeStatusMonitoring {
 | 
			
		||||
      # return value 0 means not support. 1 means yes. 
 | 
			
		||||
      if ($method > 0) {
 | 
			
		||||
        #start nodes tatus monitoring
 | 
			
		||||
        my @ret2 = ${$module_name."::"}{startNodeStatusMon}->(getMonHierarchy()); 
 | 
			
		||||
        my @ret2 = ${$module_name."::"}{startNodeStatusMon}->(); 
 | 
			
		||||
        return @ret2;
 | 
			
		||||
      }         
 | 
			
		||||
      else {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,11 +1,14 @@
 | 
			
		||||
#!/usr/bin/env perl
 | 
			
		||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
 | 
			
		||||
 | 
			
		||||
package xCAT_monitoring::templatemon;
 | 
			
		||||
BEGIN
 | 
			
		||||
{
 | 
			
		||||
  $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
 | 
			
		||||
}
 | 
			
		||||
use lib "$::XCATROOT/lib/perl";
 | 
			
		||||
 | 
			
		||||
#use xCAT::NodeRange;
 | 
			
		||||
#use Socket;
 | 
			
		||||
#use xCAT::Utils;
 | 
			
		||||
 | 
			
		||||
use xCAT_monitoring::monitorctrl;
 | 
			
		||||
 | 
			
		||||
1;
 | 
			
		||||
#-------------------------------------------------------------------------------
 | 
			
		||||
@@ -32,22 +35,15 @@ package xCAT_monitoring::templatemon;
 | 
			
		||||
      monitored by the product are in sync with the nodes currently
 | 
			
		||||
      in the xCAT cluster.
 | 
			
		||||
    Arguments:
 | 
			
		||||
      monservers --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', 'active'], ['node2', 'switch', 'booting']...], ...}   
 | 
			
		||||
      None.
 | 
			
		||||
    Returns:
 | 
			
		||||
      (return code, message)      
 | 
			
		||||
=cut
 | 
			
		||||
#--------------------------------------------------------------------------------
 | 
			
		||||
sub start {
 | 
			
		||||
  my $monservers=shift;
 | 
			
		||||
  if ($monservers =~ /xCAT_monitoring::templatemon/) {
 | 
			
		||||
    $monservers=shift;
 | 
			
		||||
  }
 | 
			
		||||
  my $monservers=xCAT_monitoring::monitorctrl->getMonHierarchy();
 | 
			
		||||
 | 
			
		||||
  #demo how you can parse the input. you may commnet it out.
 | 
			
		||||
  my $monservers=shift;
 | 
			
		||||
  foreach (keys(%$monservers)) {
 | 
			
		||||
    print "  monitoring server: $_\n";
 | 
			
		||||
    my $mon_nodes=$monservers->{$_};
 | 
			
		||||
@@ -120,13 +116,9 @@ sub supportNodeStatusMon {
 | 
			
		||||
=cut
 | 
			
		||||
#--------------------------------------------------------------------------------
 | 
			
		||||
sub startNodeStatusMon {
 | 
			
		||||
  my $monservers=shift;
 | 
			
		||||
  if ($monservers =~ /xCAT_monitoring::templatemon/) {
 | 
			
		||||
    $monservers=shift;
 | 
			
		||||
  }
 | 
			
		||||
  my $monservers=xCAT_monitoring::monitorctrl->getMonHierarchy();
 | 
			
		||||
 | 
			
		||||
  #demo how you can parse the input. you may commnet it out.
 | 
			
		||||
  my $monservers=shift;
 | 
			
		||||
  foreach (keys(%$monservers)) {
 | 
			
		||||
    print "  monitoring server: $_\n";
 | 
			
		||||
    my $mon_nodes=$monservers->{$_};
 | 
			
		||||
 
 | 
			
		||||
@@ -28,10 +28,7 @@ print "xCAT_monitoring::snmpmon loaded\n";
 | 
			
		||||
      This function gets called by the monitorctrl module
 | 
			
		||||
      when xcatd starts. 
 | 
			
		||||
    Arguments:
 | 
			
		||||
      monservers --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', 'active'], ['node2', 'switch', 'booting']...], ...}   
 | 
			
		||||
      None.
 | 
			
		||||
    Returns:
 | 
			
		||||
      (return code, message)      
 | 
			
		||||
=cut
 | 
			
		||||
@@ -227,10 +224,7 @@ sub supportNodeStatusMon {
 | 
			
		||||
    to xCAT. SNMP does not have this support.
 | 
			
		||||
 | 
			
		||||
    Arguments:
 | 
			
		||||
      monservers --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', 'active'], ['node2', 'switch', 'booting']...], ...}   
 | 
			
		||||
       None.
 | 
			
		||||
    Returns:
 | 
			
		||||
        (return code, message)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -27,10 +27,7 @@ use Sys::Hostname;
 | 
			
		||||
      This function gets called by the monitorctrl module
 | 
			
		||||
      when xcatd starts.  
 | 
			
		||||
    Arguments:
 | 
			
		||||
      monservers --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', 'active'], ['node2', 'switch', 'booting']...], ...}
 | 
			
		||||
      None.
 | 
			
		||||
    Returns:
 | 
			
		||||
      (return code, message)      
 | 
			
		||||
=cut
 | 
			
		||||
@@ -85,10 +82,7 @@ sub supportNodeStatusMon {
 | 
			
		||||
    the product to start monitoring the node status and feed them back
 | 
			
		||||
    to xCAT.  
 | 
			
		||||
    Arguments:
 | 
			
		||||
      monservers --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', 'active'], ['node2', 'switch', 'booting']...], ...}   
 | 
			
		||||
      None.
 | 
			
		||||
    Returns:
 | 
			
		||||
        (return code, message)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user