IBMDirector_SNMPCheck Resource Model Documentation


This resource model monitors the output of the command SNMPCheck_sh

General Info

Internal NameIBMDirector_SNMPCheck
Descriptive NameSNMPCheck_sh Monitor
Platformsw32-ix86
CategoryWizGenRM
Category DescriptionWizard Generated Resource Models
Cycle Time300
Version1.0

Dynamic Model

Events

Internal NameEv_SNMPCheck_sh_ScriptResult_matches
Descriptive NameSNMP Service
DescriptionThis event is sent when the SNMP service goes down.
MessageThe IBM Director SNMP Service is Down.
Numeric Attributes
    String Attributes
    • prev_value
    • value
    • relation_delta
    • ScriptResult
    Keys
      Occurrences1
      Holes0
      Clearing EventTRUE
      Send to TECTRUE
      Send to TBSMFALSE
      SeverityCRITICAL
      Action
      Internal NameRestartSNMP
      Shell Program./reloadsnmp.sh
      Descriptive NameRestarts the SNMP service
      DescriptionRestarts the SNMP service

      Thresholds

      Internal NameDescriptive NameDescriptionDefault Value

      Parameters

      Internal NameDescriptive NameDescriptionTypeValues
      Par_ScriptResult_eqsScriptResult matching valuesWhen the property ScriptResult is equal to one of the values of this parameter the event Ev_SNMPCheck_sh_ScriptResult_matches is generated STRING LIST
      • down

      Logging

      ContextResourceKeysNumeric AttributesString Attributes

      Decision Tree Script

      //''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
      //    IBM Tivoli Monitoring
      //    Decision Tree script
      //
      //    This file has been generated by IBM Tivoli Monitoring Workbench
      //
      //    02/27/2003 17:07:58
      
      //'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
      
      var hTableScriptResult;
      var flagNotFirstRun = 0;
      
      
      
      // This function is used to define the settings of the resource model
      // It is called only once, when the resource model is started.
      // Don't modify remarks containing tags like <<....>> ... <<\...>>
      // You can write additional initializing code in this function if required. 
      function SetDefaultConfiguration (Svc)
      {
      	// General info section
      	//<<GENERAL_INFO>>
      	Svc.SetModelName ("IBMDirector_SNMPCheck");
      	Svc.SetProfileName ("63982578");
      	Svc.SetCycleTime (300);
      	//<<\GENERAL_INFO>>
      
      	// Thresholds section
      	//<<THRESHOLDS_INFO>>
      	//<<\THRESHOLDS_INFO>>
      
      	// Parameters section
      	//<<PARAMETERS_INFO>>
      	Svc.DefineStrParameter ("Par_ScriptResult_eqs", "down");
      	//<<\PARAMETERS_INFO>>
      
      	// Dynamic model section
      	//<<DATA_INFO>>
      	//<<\DATA_INFO>>
      
      	// Event definition section
      	//<<EVENTS_INFO>>
      	Svc.DefineEvent ("Ev_SNMPCheck_sh_ScriptResult_matches", "", "prev_value,value,relation_delta,ScriptResult");
      	//<<\EVENTS_INFO>>
      
      	// Logging definition section
      	//<<LOGGING_INFO>>
      	//<<\LOGGING_INFO>>
      
      	// Place your additional intializing code below
      
      
      	return (0);
      
      }
      
      
      // This function is called by the DM For Windows Analyzer after that 
      // the resource model default settings have been overridden
      // It is called only once, when the resource model is started.
      // You can write additional initializing code in this function if required
      // to use the thresholds and parameters values
      function Init(Svc)
      {
      	hTableScriptResult = Svc.CreateMap();
      
      	return (0);
      
      }
      
      
      
      // This function contains the monitoring algorithm
      // It is called ciclically after a cycle time has elapsed
      // Implement the the monitoring code here
      function VisitTree(Svc)
      {
      
      	var curScriptResult;
      
      	var hashKey;
      	var found;
      
      	var OldScriptResult;
      
      	var hPropTable;
      	var ProbeArgCount;
      	var ProbeArgIdx;
      	var ParamCount;
      	var ParamIdx;
      	var Different;
      
      	hPropTable = Svc.CreateMap();
      
      	//Implementation for the monitor ScriptResult
      	Svc.RemoveMapAll(hPropTable);
      	hashKey = "ScriptResult";
      	curScriptResult = Svc.Shell ("SNMPCheck.sh");
      	Svc.SetMapStrElement(hPropTable,"ScriptResult",curScriptResult);
      	found = Svc.ExistsMapElement(hTableScriptResult, hashKey);
      	if (found)
      		OldScriptResult = Svc.GetMapStrValue(hTableScriptResult, hashKey);
      	else
      		OldScriptResult = "";
      	
      	Svc.SetMapStrElement(hPropTable,"OldScriptResult",OldScriptResult);
      	Svc.SetMapStrElement(hPropTable,"prev_value", OldScriptResult);
      	Svc.SetMapStrElement(hPropTable,"value", curScriptResult);
      	Svc.SetMapStrElement(hPropTable,"relation_delta","");
      	ParamCount = Svc.GetStrParameterCount("Par_ScriptResult_eqs");
      	for (ParamIdx = 0;  ParamIdx < ParamCount; ParamIdx++) {
      		if ((curScriptResult.toLowerCase() + "") == (Svc.GetStrParameter("Par_ScriptResult_eqs", ParamIdx).toLowerCase())) {
      		Svc.SendEventEx ("Ev_SNMPCheck_sh_ScriptResult_matches",hPropTable);
      		}
      	}
      
      	Svc.SetMapStrElement(hTableScriptResult, hashKey, curScriptResult);
      
      	Svc.DestroyMap(hPropTable);
      
      	return (0);
      
      }
      
      

      Dependencies

      All
      • ReloadSNMP.sh
      • SNMPCheck.sh
      w32-ix86


        This Html document has been generated by IBM Tivoli Monitoring Workbench