Sis intergration monitor

Step by Step description of our problem :


1. We import Measurements via SiteScope Logfile Integration to BAC :

Logfile looks like this :
30.03.2009;00:49:01;ATDEV1;MAINFRAME;100;MF-SLA3
30.03.2009;00:49:01;AIL1;MAINFRAME;100;MF-SLA3
30.03.2009;01:47:01;ATDEV1;MAINFRAME;80;MF-SLA3
30.03.2009;01:47:01;AIL1;MAINFRAME;80;MF-SLA3
30.03.2009;02:48:01;ATDEV1;MAINFRAME;66.666667;MF-SLA3
30.03.2009;02:48:01;AIL1;MAINFRAME;66.666667;MF-SLA3
30.03.2009;03:49:01;ATDEV1;MAINFRAME;100;MF-SLA3
30.03.2009;03:49:01;AIL1;MAINFRAME;100;MF-SLA3
30.03.2009;04:47:01;ATDEV1;MAINFRAME;80;MF-SLA3
30.03.2009;04:47:01;AIL1;MAINFRAME;80;MF-SLA3
30.03.2009;05:48:01;ATDEV1;MAINFRAME;66.666667;MF-SLA3
30.03.2009;05:48:01;AIL1;MAINFRAME;66.666667;MF-SLA3
30.03.2009;06:49:01;ATDEV1;MAINFRAME;100;MF-SLA3
30.03.2009;06:49:01;AIL1;MAINFRAME;100;MF-SLA3
30.03.2009;07:47:01;ATDEV1;MAINFRAME;80;MF-SLA3
30.03.2009;07:47:01;AIL1;MAINFRAME;80;MF-SLA3
30.03.2009;08:48:01;ATDEV1;MAINFRAME;66.666667;MF-SLA3
30.03.2009;08:48:01;AIL1;MAINFRAME;66.666667;MF-SLA3
30.03.2009;09:49:01;ATDEV1;MAINFRAME;100;MF-SLA3
30.03.2009;09:49:01;AIL1;MAINFRAME;100;MF-SLA3
30.03.2009;10:47:01;ATDEV1;MAINFRAME;80;MF-SLA3
30.03.2009;10:47:01;AIL1;MAINFRAME;80;MF-SLA3
30.03.2009;11:48:01;ATDEV1;MAINFRAME;66.666667;MF-SLA3
30.03.2009;11:48:01;AIL1;MAINFRAME;66.666667;MF-SLA3
30.03.2009;12:49:01;ATDEV1;MAINFRAME;100;MF-SLA3
30.03.2009;12:49:01;AIL1;MAINFRAME;100;MF-SLA3





regular Expression : /(\d+\.\d+\.\d+\;\d+:\d+:\d+);(\w+);(\w+);(\d+|\d+\.\d+);(.*)/

Field mapping Script :

#####################################################################
# EMS Integration metrics config file           #
# Use this file to send metrics to Business Availability Center     #
#     #
# Refer to "Integration Monitor Configuration Files" in SiteScope   #
#  documentation for more information.          # 
#####################################################################

[$DEFAULT_PARAMETERS$]
# Time stamp in seconds since Jan 1st 1970 format.
# Use time() to get the sitescope host time or str_to_seconds() to read a value from the input event
TimeStamp:DOUBLE=str_to_seconds($group0, "dd.MM.yyyy;HH:mm:ss")

# Quailty in SiteScope terms: QUALITY_ERROR, QUALITY_WARNING, QUALITY_GOOD
#Quality:INT="1".equals($group3) ? QUALITY_GOOD : ("0".equals($group3) ? QUALITY_ERROR : QUALITY_GOOD)
Quality:INT=QUALITY_GOOD

# Logical monitor name (e.g. "Whatsup Gold log integration")
MonitorName=  "LPAR_Availability_" + $group1

# The name of the host / device that caused this event. If the name cannot be determined an IP address can be used instead
TargetName=$group1
target_name=$group1

# The status string of the monitor (e.g: "Log file read, 3 matches found")
MonitorState="LPAR Availability for " + $group1 + " = " + $group3 + " - " + $group4

subject="system"

# The monitor type (e.g. "Log Monitor", "CPU Monitor" )
MonitorType="LPAR"
data_source="LPAR"
host_type="lpar"
target_ip="127.0.0.1"
host_os="0.0.0.0.0.0"
host_description="LPAR"


# Measurement name (e.g. "matches per minute", "CPU Utilization")
MeasurementName(1)="LPAR_Availability"
# Value as double
Value(1):DOUBLE=$group3

############################################################
# In order to send more than one measurement    #
# per DB row / Log file line add pairs                     #
# MeasurementName(*)=                    #
# Value(*):DOUBLE=            #
# where * = 1,2,.,n            #
# ##########################################################


[allR]
$MATCH=true
$ACTION=TOPAZ_BUS_POST(ss_t)




Topology Script :



# Please write your script here...
import logger
import common_lib
import ems_lib
import system_lib


# Java imports
from java.lang import *
from java.util import *
from appilog.common.system.types.vectors import ObjectStateHolderVector
from appilog.common.system.types import ObjectStateHolder
from appilog.common.system.types import AttributeStateHolder

def DiscoveryMain(Framework):
global OSHVResult
OSHVResult = ObjectStateHolderVector()

monitorSource = Framework.getDestinationAttribute("data_source")

########## Custom

host_name = Framework.getDestinationAttribute("target_name")
short_host_name = Framework.getDestinationAttribute("target_name")
host_ip = Framework.getDestinationAttribute("target_ip")

default_domain = Framework.getDestinationAttribute("domain_name")
#host_domain = DomainScopeManager.getDomainByIp(host_ip, default_domain)
domainName = DomainScopeManager.getDomainByIp(host_ip, default_domain)

#host_type = Framework.getDestinationAttribute("host_type")
host_type = "lpar"

logger.info("OSHVector contains ", host_type)
logger.info("OSHVector contains ", host_ip)
logger.info("OSHVector contains XXXXXX", host_domain)
logger.info("OSHVector contains ", host_type)



hostType = "lpar"
logger.info("OSHVector contains", hostType)
host = ObjectStateHolder(hostType)

if host_ip != None:
host_id = host_ip + " " + domainName
else:
host_id = host_name + " " +  domainName

host.setAttribute("host_key", host_id)
host.setAttribute("host_dnsname", host_name)
host.setAttribute("host_hostname", short_host_name)

host.setBoolAttribute("root_enableageing", "true")
host.setBoolAttribute("host_iscomplete","true")


###### #host_os = Framework.getDestinationAttribute("host_os")
host_os = "0.0.0.0.0.0"
if host_os != None:
host.setAttribute("host_os", host_os)

#host_description = Framework.getDestinationAttribute("host_description")
host_description = "LPAR"
if host_description != None:
host.setAttribute("data_description", host_description)


# creating the host
OSHVResult.add(host)

########
# creating the ems monitor (that monitors the host)
#monitorId = String.valueOf(host.getAttribute("host_dnsname").getValue())
monitorId = Framework.getDestinationAttribute("target_name")
monitorHost = ems_lib.createEMSMonitor(monitorId, monitorSource, "lpar")
OSHVResult.add(monitorHost)

# connecting the ems monitor to the host
linkHostMonitor = common_lib.createAgingLink("monitored_by", host, monitorHost)
OSHVResult.add(linkHostMonitor)

monitoredCIType = String.valueOf(monitorHost.getAttribute("monitored_ci_type").getValue())

Framework.setUserObject("result_object", monitoredCIType)

return OSHVResult

















In BAC SAM we see the data :


Measurement Name = LPAR_Availabilty











Cloned KPI : Availability LPAR (ID = 2006)


New Business Rule (cloned from : SiteScope Measurement Rule) with ID = 2003








<condition cmdb-class="sitescope_monitor">
    <property-condition name="monitor_type" operator="LIKE" value="%LPAR%"/>
    <property-condition name="managed_by" operator="EQ" value="Discovery:SiteScope"/>
</condition>

<task-config>
    <contextmenu id="ssMonitorMenu"/>
    <kpis-config>
        <kpi-config type="1">
            <rule type="4"/>
            <trinity-selector override-ci-selector="true">
                <CompositeSelector logicalOp="OR">
                    <CompositeSelector logicalOp="AND">
                        <Selector key="sampleType" op="EQ" type="String" value="ss_monitor_t"/>
                        <Selector key="u_iConnectionId" op="EQ"
                            type="Long" value="RefProp:monitor_id"/>
                        <Selector key="u_iSessionId" op="EQ" type="Long" value="RefProp:session_id"/>
                    </CompositeSelector>
                    <CompositeSelector logicalOp="AND">
                        <Selector key="sampleType" op="EQ" type="String" value="ss_t"/>
                        <Selector key="u_iConnectionId" op="EQ"
                            type="Long" value="RefProp:monitor_id"/>
                        <Selector key="u_iSessionId" op="EQ" type="Long" value="RefProp:session_id"/>
                    </CompositeSelector>
                </CompositeSelector>
            </trinity-selector>
        </kpi-config>
        <kpi-config type="2006">
            <rule type="2003">
                <rule-parameter key="No data timeout" type="Long" value="86400"/>
            </rule>
            <trinity-selector>
                <CompositeSelector logicalOp="AND">
                    <Selector key="sampleType" op="EQ" type="String" value="ss_t"/>
                    <Selector key="szCategoryName" op="EQ" type="String" value="lpar_availability"/>
                    <Selector key="u_iConnectionId" op="EQ" type="Long" value="RefProp:monitor_id"/>
                    <Selector key="u_iSessionId" op="EQ" type="Long" value="RefProp:session_id"/>
                </CompositeSelector>
            </trinity-selector>
        </kpi-config>
    </kpis-config>
</task-config>


2. Now we want to use these data also in SLM :

So, we created a CI based SLA :





Then we added the SiteScope Performance KPI to our SLA CIs ( in addition to the SiteScope Availability KPI, which was already there).


Business Rule = SiteScope Monitor Average Value



As Measurement Type we entered the Measurement Name = LPAR_Availability (see above),
which holds the required data.





In addition, we enabled the measurement type filtering, as mentioned in the docs :


Edit the XML File to Enable Measurement Type Filtering  
a. Open the following file: <Data Processing server root directory>\conf\ ble_offline_dssampletype_adapters.xml.
b. Within the XML file, find the following parent tag:
<DSSampleAdapter Type="legacy" SampleType="ss_t">.
Within this tag, add the following text after the line </FilteringFields>:
<SelectingFields>
    <Field Name="time_stamp"/>
    <Field Name="start_time"/>
    <Field Name="frequency"/>
    <Field Name="cfg_frequency"/>
    <Field Name="u_iSessionId "/>
    <Field Name="u_iMeasurementId"/>
    <Field Name="szCategoryName"/>
    <Field Name="u_iMonitorId"/>
    <Field Name="u_iTargetId"/>
    <Field Name="u_iConnectionId"/>
    <Field Name="u_iStatus"/>
    <Field Name="u_iCategoryId"/>
    <Field Name="u_iQuality"/>
    <Field Name="instance_id"/>
    <Field Name="u_iHasProperty"/>
    <Field Name="iErrCode"/>
    <Field Name="dValue"/>
    <Field Name="monitor_curr_quality"/>
</SelectingFields>
c. Save the edited XML file and restart the offline engine.





 SLA works fine


你可能感兴趣的:(xml,OS,performance)