From a4b06244dcba3f7b789693a2409365c68656624c Mon Sep 17 00:00:00 2001 From: EMaksy Date: Tue, 30 Jul 2024 11:04:43 +0200 Subject: [PATCH 1/3] Add photofinish scenario for java discovery --- .photofinish.toml | 4 + ...8cf-e6b8db4606f6_sap_system_discovery.json | 22 +- ...917-655af1bb4b58_sap_system_discovery.json | 22 +- ...82a-d5cfafe1c4e9_sap_system_discovery.json | 22 +- ...d21-b9a5-e300a9c5eeee_cloud_discovery.json | 92 ++++ ...4d21-b9a5-e300a9c5eeee_host_discovery.json | 26 ++ ...9a5-e300a9c5eeee_sap_system_discovery.json | 395 ++++++++++++++++++ ...1-b9a5-e300a9c5eeee_saptune_discovery.json | 101 +++++ ...5-e300a9c5eeee_subscription_discovery.json | 74 ++++ 9 files changed, 749 insertions(+), 9 deletions(-) create mode 100644 test/fixtures/scenarios/sap-system-java/a18a203d-4f2f-4d21-b9a5-e300a9c5eeee_cloud_discovery.json create mode 100644 test/fixtures/scenarios/sap-system-java/a18a203d-4f2f-4d21-b9a5-e300a9c5eeee_host_discovery.json create mode 100644 test/fixtures/scenarios/sap-system-java/a18a203d-4f2f-4d21-b9a5-e300a9c5eeee_sap_system_discovery.json create mode 100644 test/fixtures/scenarios/sap-system-java/a18a203d-4f2f-4d21-b9a5-e300a9c5eeee_saptune_discovery.json create mode 100644 test/fixtures/scenarios/sap-system-java/a18a203d-4f2f-4d21-b9a5-e300a9c5eeee_subscription_discovery.json diff --git a/.photofinish.toml b/.photofinish.toml index cb0a7a02a7..b42abe2afc 100644 --- a/.photofinish.toml +++ b/.photofinish.toml @@ -30,6 +30,10 @@ directories = ["./test/fixtures/scenarios/gcp-landscape"] directories = ["./test/fixtures/scenarios/multi-tenant"] +[java-system] + +directories = ["./test/fixtures/scenarios/sap-system-java"] + [sap-system-detail-GRAY] files = [ diff --git a/test/fixtures/scenarios/multi-tenant/544cbc99-c856-4b0a-88cf-e6b8db4606f6_sap_system_discovery.json b/test/fixtures/scenarios/multi-tenant/544cbc99-c856-4b0a-88cf-e6b8db4606f6_sap_system_discovery.json index 0f913ba6a0..8e0dc21c71 100644 --- a/test/fixtures/scenarios/multi-tenant/544cbc99-c856-4b0a-88cf-e6b8db4606f6_sap_system_discovery.json +++ b/test/fixtures/scenarios/multi-tenant/544cbc99-c856-4b0a-88cf-e6b8db4606f6_sap_system_discovery.json @@ -24,12 +24,26 @@ "SqlPort": "30344", "User": "", "UserId": "" + }, + { + "Active": "yes", + "Container": "", + "Database": "HTJ", + "Group": "", + "GroupId": "", + "Host": "hanadb3", + "SqlPort": "30348", + "User": "", + "UserId": "" } ], "Id": "c0725f6b267f4216ba03be128ce08b27", "Instances": [ { - "HdbnsutilSRstate": { "mode": "none", "online": "true" }, + "HdbnsutilSRstate": { + "mode": "none", + "online": "true" + }, "Host": "hanadb3", "HostConfiguration": { "host/hanadb3/workerActualGroups": "-", @@ -227,7 +241,9 @@ } ] }, - "SystemReplication": { "local_site_id": "0" }, + "SystemReplication": { + "local_site_id": "0" + }, "Type": 1 } ], @@ -245,4 +261,4 @@ ], "discovery_type": "sap_system_discovery", "agent_id": "544cbc99-c856-4b0a-88cf-e6b8db4606f6" -} +} \ No newline at end of file diff --git a/test/fixtures/scenarios/multi-tenant/e0564d66-be9e-4763-9917-655af1bb4b58_sap_system_discovery.json b/test/fixtures/scenarios/multi-tenant/e0564d66-be9e-4763-9917-655af1bb4b58_sap_system_discovery.json index 40636c37fc..70fdbdce5c 100644 --- a/test/fixtures/scenarios/multi-tenant/e0564d66-be9e-4763-9917-655af1bb4b58_sap_system_discovery.json +++ b/test/fixtures/scenarios/multi-tenant/e0564d66-be9e-4763-9917-655af1bb4b58_sap_system_discovery.json @@ -24,12 +24,26 @@ "SqlPort": "30344", "User": "", "UserId": "" + }, + { + "Active": "yes", + "Container": "", + "Database": "HTJ", + "Group": "", + "GroupId": "", + "Host": "hanadb3", + "SqlPort": "30348", + "User": "", + "UserId": "" } ], "Id": "c0725f6b267f4216ba03be128ce08b27", "Instances": [ { - "HdbnsutilSRstate": { "mode": "none", "online": "true" }, + "HdbnsutilSRstate": { + "mode": "none", + "online": "true" + }, "Host": "hanadb2", "HostConfiguration": { "host/hanadb3/workerActualGroups": "-", @@ -236,7 +250,9 @@ } ] }, - "SystemReplication": { "local_site_id": "0" }, + "SystemReplication": { + "local_site_id": "0" + }, "Type": 1 } ], @@ -254,4 +270,4 @@ ], "discovery_type": "sap_system_discovery", "agent_id": "e0564d66-be9e-4763-9917-655af1bb4b58" -} +} \ No newline at end of file diff --git a/test/fixtures/scenarios/multi-tenant/f7a8969b-db9e-4162-b82a-d5cfafe1c4e9_sap_system_discovery.json b/test/fixtures/scenarios/multi-tenant/f7a8969b-db9e-4162-b82a-d5cfafe1c4e9_sap_system_discovery.json index 2f64a5bae7..5e98306bac 100644 --- a/test/fixtures/scenarios/multi-tenant/f7a8969b-db9e-4162-b82a-d5cfafe1c4e9_sap_system_discovery.json +++ b/test/fixtures/scenarios/multi-tenant/f7a8969b-db9e-4162-b82a-d5cfafe1c4e9_sap_system_discovery.json @@ -24,12 +24,26 @@ "SqlPort": "30344", "User": "", "UserId": "" + }, + { + "Active": "yes", + "Container": "", + "Database": "HTJ", + "Group": "", + "GroupId": "", + "Host": "hanadb3", + "SqlPort": "30348", + "User": "", + "UserId": "" } ], "Id": "c0725f6b267f4216ba03be128ce08b27", "Instances": [ { - "HdbnsutilSRstate": { "mode": "none", "online": "true" }, + "HdbnsutilSRstate": { + "mode": "none", + "online": "true" + }, "Host": "hanadb1", "HostConfiguration": { "host/hanadb3/workerActualGroups": "-", @@ -236,7 +250,9 @@ } ] }, - "SystemReplication": { "local_site_id": "0" }, + "SystemReplication": { + "local_site_id": "0" + }, "Type": 1 } ], @@ -254,4 +270,4 @@ ], "discovery_type": "sap_system_discovery", "agent_id": "f7a8969b-db9e-4162-b82a-d5cfafe1c4e9" -} +} \ No newline at end of file diff --git a/test/fixtures/scenarios/sap-system-java/a18a203d-4f2f-4d21-b9a5-e300a9c5eeee_cloud_discovery.json b/test/fixtures/scenarios/sap-system-java/a18a203d-4f2f-4d21-b9a5-e300a9c5eeee_cloud_discovery.json new file mode 100644 index 0000000000..3187c9b067 --- /dev/null +++ b/test/fixtures/scenarios/sap-system-java/a18a203d-4f2f-4d21-b9a5-e300a9c5eeee_cloud_discovery.json @@ -0,0 +1,92 @@ +{ + "agent_id": "a18a203d-4f2f-4d21-b9a5-e300a9c5eeee", + "discovery_type": "cloud_discovery", + "payload": { + "Metadata": { + "compute": { + "azEnvironment": "AzurePublicCloud", + "isHostCompatibilityLayerVm": "true", + "location": "westeurope", + "name": "vmnwjava01", + "offer": "sles-sap-15-sp5-byos", + "osProfile": { + "adminUsername": "cloudadmin", + "computerName": "vmnwjava01", + "disablePasswordAuthentication": "true" + }, + "osType": "Linux", + "plan": {}, + "platformFaultDomain": "0", + "platformUpdateDomain": "0", + "provider": "Microsoft.Compute", + "publisher": "suse", + "resourceGroupName": "java-system", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/java-system/providers/Microsoft.Compute/virtualMachines/vmnwjava01", + "securityProfile": { + "secureBootEnabled": "true", + "virtualTpmEnabled": "true" + }, + "sku": "gen2", + "storageProfile": { + "imageReference": { + "offer": "sles-sap-15-sp5-byos", + "publisher": "suse", + "sku": "gen2", + "version": "latest" + }, + "osDisk": { + "caching": "ReadWrite", + "createOption": "FromImage", + "diffDiskSettings": { + "option": "" + }, + "diskSizeGB": "30", + "encryptionSettings": { + "enabled": "false" + }, + "image": { + "uri": "" + }, + "managedDisk": { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/java-system/providers/Microsoft.Compute/disks/vmnwjava01_OsDisk_1", + "storageAccountType": "Premium_LRS" + }, + "name": "vmnwjava01_OsDisk_1", + "osType": "Linux", + "vhd": { + "uri": "" + }, + "writeAcceleratorEnabled": "false" + } + }, + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "tags": "", + "version": "2024.05.08", + "vmId": "4c94f16f-9028-4d76-9dc6-6c7894307420", + "vmSize": "Standard_D2s_v3" + }, + "network": { + "interface": [ + { + "ipv4": { + "ipAddress": [ + { + "privateIpAddress": "10.23.0.6" + } + ], + "subnet": [ + { + "address": "10.23.0.0", + "prefix": "24" + } + ] + }, + "ipv6": {}, + "macAddress": "AEE47C8D414E" + } + ] + } + }, + "Provider": "azure" + } +} \ No newline at end of file diff --git a/test/fixtures/scenarios/sap-system-java/a18a203d-4f2f-4d21-b9a5-e300a9c5eeee_host_discovery.json b/test/fixtures/scenarios/sap-system-java/a18a203d-4f2f-4d21-b9a5-e300a9c5eeee_host_discovery.json new file mode 100644 index 0000000000..ede957dc0f --- /dev/null +++ b/test/fixtures/scenarios/sap-system-java/a18a203d-4f2f-4d21-b9a5-e300a9c5eeee_host_discovery.json @@ -0,0 +1,26 @@ +{ + "agent_id": "a18a203d-4f2f-4d21-b9a5-e300a9c5eeee", + "discovery_type": "host_discovery", + "payload": { + "agent_version": "2.3.0", + "cpu_count": 2, + "fully_qualified_domain_name": "vmnwjava01.ax.internal.cloudapp.net", + "hostname": "vmnwjava01", + "installation_source": "Suse", + "ip_addresses": [ + "127.0.0.1", + "::1", + "10.23.0.6", + "fe80::222:48ff:fe8b:756f" + ], + "netmasks": [ + "8", + "128", + "24", + "64" + ], + "os_version": "15-SP5", + "socket_count": 1, + "total_memory_mb": 7888 + } +} \ No newline at end of file diff --git a/test/fixtures/scenarios/sap-system-java/a18a203d-4f2f-4d21-b9a5-e300a9c5eeee_sap_system_discovery.json b/test/fixtures/scenarios/sap-system-java/a18a203d-4f2f-4d21-b9a5-e300a9c5eeee_sap_system_discovery.json new file mode 100644 index 0000000000..ce3a82cb8a --- /dev/null +++ b/test/fixtures/scenarios/sap-system-java/a18a203d-4f2f-4d21-b9a5-e300a9c5eeee_sap_system_discovery.json @@ -0,0 +1,395 @@ +{ + "agent_id": "a18a203d-4f2f-4d21-b9a5-e300a9c5eeee", + "discovery_type": "sap_system_discovery", + "payload": [ + { + "DBAddress": "10.17.0.4", + "Databases": null, + "Id": "db147370303d6259a197a19467e7acd1", + "Instances": [ + { + "HdbnsutilSRstate": null, + "Host": "vmnwjava01", + "HostConfiguration": null, + "Name": "J80", + "SAPControl": { + "Instances": [ + { + "dispstatus": "SAPControl-GREEN", + "features": "GATEWAY|MESSAGESERVER|ENQUE", + "hostname": "hsonwjava", + "httpPort": 58113, + "httpsPort": 58114, + "instanceNr": 81, + "startPriority": "1" + }, + { + "dispstatus": "SAPControl-GREEN", + "features": "J2EE|IGS", + "hostname": "hsonwjava", + "httpPort": 58013, + "httpsPort": 58014, + "instanceNr": 80, + "startPriority": "3" + } + ], + "Processes": [ + { + "description": "J2EE Server", + "dispstatus": "SAPControl-GREEN", + "elapsedtime": "1:30:27", + "name": "jstart", + "pid": 22698, + "starttime": "2024 06 12 14:01:33", + "textstatus": "All processes running" + }, + { + "description": "IGS Watchdog", + "dispstatus": "SAPControl-GREEN", + "elapsedtime": "1:30:27", + "name": "igswd_mt", + "pid": 22699, + "starttime": "2024 06 12 14:01:33", + "textstatus": "Running" + } + ], + "Properties": [ + { + "property": "Process List", + "propertytype": "NodeWebmethod", + "value": "GetProcessList" + }, + { + "property": "Access Points", + "propertytype": "NodeWebmethod", + "value": "GetAccessPointList" + }, + { + "property": "Parameter Documentation", + "propertytype": "NodeURL", + "value": "http://hsonwjava:58013/sapparamEN.html" + }, + { + "property": "Kernel Update", + "propertytype": "NodeURL", + "value": "https://launchpad.support.sap.com/#/softwarecenter/template/products/_APP=00200682500000001943&_EVENT=DISPHIER&HEADER=Y&FUNCTIONBAR=N&EVENT=TREE&NE=NAVIGATE&ENR=73554900100200005858&V=MAINT" + }, + { + "property": "Current Status", + "propertytype": "NodeWebmethod", + "value": "GetAlertTree" + }, + { + "property": "Open Alerts", + "propertytype": "NodeWebmethod", + "value": "GetAlertTree" + }, + { + "property": "Syslog", + "propertytype": "NodeWebmethod", + "value": "ABAPReadSyslog" + }, + { + "property": "Queue Statistic", + "propertytype": "NodeWebmethod", + "value": "GetQueueStatistic" + }, + { + "property": "J2EE Process Table", + "propertytype": "NodeWebmethod", + "value": "J2EEGetProcessList2,J2EEGetProcessList" + }, + { + "property": "J2EE Components", + "propertytype": "NodeWebmethod", + "value": "J2EEGetComponentList" + }, + { + "property": "J2EE Caches", + "propertytype": "NodeWebmethod", + "value": "J2EEGetCacheStatistic2,J2EEGetCacheStatistic" + }, + { + "property": "J2EE Threads", + "propertytype": "NodeWebmethod", + "value": "J2EEGetThreadList2,J2EEGetThreadList" + }, + { + "property": "J2EE Sessions", + "propertytype": "NodeWebmethod", + "value": "J2EEGetWebSessionList2,J2EEGetWebSessionList,J2EEGetSessionList" + }, + { + "property": "J2EE EJB Sessions", + "propertytype": "NodeWebmethod", + "value": "J2EEGetEJBSessionList" + }, + { + "property": "J2EE Remote Objects", + "propertytype": "NodeWebmethod", + "value": "J2EEGetRemoteObjectList" + }, + { + "property": "J2EE Aliases", + "propertytype": "NodeWebmethod", + "value": "J2EEGetApplicationAliasList" + }, + { + "property": "J2EE Shared Table Info", + "propertytype": "NodeWebmethod", + "value": "J2EEGetSharedTableInfo" + }, + { + "property": "J2EE GC History", + "propertytype": "NodeWebmethod", + "value": "J2EEGetVMGCHistory2,J2EEGetVMGCHistory" + }, + { + "property": "J2EE Heap Memory", + "propertytype": "NodeWebmethod", + "value": "J2EEGetVMHeapInfo" + }, + { + "property": "ICM", + "propertytype": "NodeURL", + "value": "HTTP://hsonwjava:58000/sap/admin/public/index.html" + }, + { + "property": "ICM Threads", + "propertytype": "NodeWebmethod", + "value": "ICMGetThreadList" + }, + { + "property": "ICM Connections", + "propertytype": "NodeWebmethod", + "value": "ICMGetConnectionList" + }, + { + "property": "ICM Cache", + "propertytype": "NodeWebmethod", + "value": "ICMGetCacheEntries" + }, + { + "property": "ICM Proxy Connections", + "propertytype": "NodeWebmethod", + "value": "ICMGetProxyConnectionList" + }, + { + "property": "Protected Webmethods", + "propertytype": "Attribute", + "value": "ABAPAcknowledgeAlerts,ABAPCheckRFCDestinations,ABAPGetComponentList,ABAPGetSystemWPTable,ABAPGetWPTable,ABAPReadRawSyslog,ABAPReadSyslog,ABAPSetServerInactive,AnalyseLogFiles,Bootstrap,CheckParameter,CheckPSE,CheckUpdateSystem,ConfigureLogFileList,CreatePSECredential,CreateSnapshot,DeletePSE,DeleteSnapshots,EnqGetLockTable,EnqGetStatistic,EnqRemoveLocks,EnqRemoveUserLocks,GetAccessPointList,GetAlerts,GetAlertTree,GetCallstack,GetEnvironment,GetLogFileList,GetProcessParameter,GetQueueStatistic,GetStartProfile,GetSystemUpdateList,GetTraceFile,GetVersionInfo,GWCancelConnections,GWDeleteClients,GWDeleteConnections,GWGetConnectionList,GWGetClientList,HACheckConfig,HACheckFailoverConfig,HACheckMaintenanceMode,HAFailoverToNode,HAGetFailoverConfig,HASetMaintenanceMode,ICMGetCacheEntries,ICMGetConnectionList,ICMGetProxyConnectionList,ICMGetThreadList,InstanceStart,InstanceStop,J2EEControlCluster,J2EEControlComponents,J2EEControlProcess,J2EEDisableDbgSession,J2EEEnableDbgSession,J2EEGetApplicationAliasList,J2EEGetCacheStatistic,J2EEGetCacheStatistic2,J2EEGetClusterMsgList,J2EEGetComponentList,J2EEGetEJBSessionList,J2EEGetProcessList,J2EEGetProcessList2,J2EEGetRemoteObjectList,J2EEGetSessionList,J2EEGetSharedTableInfo,J2EEGetThreadCallStack,J2EEGetThreadList,J2EEGetThreadList2,J2EEGetThreadTaskStack,J2EEGetVMGCHistory,J2EEGetVMGCHistory2,J2EEGetVMHeapInfo,J2EEGetWebSessionList,J2EEGetWebSessionList2,ListConfigFiles,ListDeveloperTraces,ListLogFiles,ListSnapshots,OSExecute,ParameterValue,ReadConfigFile,ReadDeveloperTrace,ReadLogFile,ReadSnapshot,RestartInstance,RestartService,RestartSystem,SendSignal,SetProcessParameter,SetProcessParameter2,ShmDetach,Shutdown,Start,StartBypassHA,StartSystem,Stop,StopBypassHA,StopService,StopSystem,StorePSE,UpdateInstancePSE,UpdateSCSInstance,UpdateSystem,UpdateSystemPKI,WebDispGetServerList,WebDispGetGroupList,WebDispGetVirtHostList,WebDispGetUrlPrefixList,GetAgentConfig,GetListOfMaByCusGrp,GetMcInLocalMs,GetMtesByRequestTable,GetMtListByMtclass,InfoGetTree,MscCustomizeWrite,MscDeleteLines,MscReadCache,MsGetLocalMsInfo,MsGetMteclsInLocalMs,MtChangeStatus,MtCustomizeWrite,MtDbsetToWpsetByTid,MtDestroyMarkNTry,MteGetByToolRunstatus,MtGetAllToCust,MtGetAllToolsToSet,MtGetMteinfo,MtGetTidByName,MtRead,MtReset,PerfCustomizeWrite,PerfRead,PerfReadSmoothData,ReadDirectory,ReadFile,ReadProfileParameters,ReferenceRead,Register,RequestLogonFile,SnglmgsCustomizeWrite,SystemObjectSetValue,TextAttrRead,ToolGetEffective,ToolSet,ToolSetRuntimeStatus,TriggerDataCollection,Unregister,UtilAlChangeStatus,UtilMtGetAidByTid,UtilMtGetTreeLocal,UtilMtReadAll,UtilReadRawalertByAid,UtilSnglmsgReadRawdata" + }, + { + "property": "StartPriority", + "propertytype": "Attribute", + "value": "3" + }, + { + "property": "SAPSYSTEM", + "propertytype": "Attribute", + "value": "80" + }, + { + "property": "SAPSYSTEMNAME", + "propertytype": "Attribute", + "value": "NWJ" + }, + { + "property": "SAPLOCALHOST", + "propertytype": "Attribute", + "value": "hsonwjava" + }, + { + "property": "INSTANCE_NAME", + "propertytype": "Attribute", + "value": "J80" + }, + { + "property": "IGS", + "propertytype": "NodeURL", + "value": "http://hsonwjava:48080" + }, + { + "property": "Webmethods", + "propertytype": "Attribute", + "value": "Start,InstanceStart,StartBypassHA,Bootstrap,Stop,InstanceStop,StopBypassHA,Shutdown,ParameterValue,GetProcessList,GetStartProfile,GetTraceFile,GetAlertTree,GetAlerts,RestartService,StopService,GetEnvironment,ListDeveloperTraces,ReadDeveloperTrace,RestartInstance,SendSignal,GetVersionInfo,GetQueueStatistic,GetInstanceProperties,OSExecute,ReadLogFile,AnalyseLogFiles,ListLogFiles,GetAccessPointList,GetSystemInstanceList,GetSystemUpdateList,StartSystem,StopSystem,RestartSystem,UpdateSystem,UpdateSCSInstance,CheckUpdateSystem,AccessCheck,GetProcessParameter,SetProcessParameter,SetProcessParameter2,CheckParameter,ShmDetach,GetNetworkId,GetSecNetworkId,RequestLogonFile,CreateSnapshot,ReadSnapshot,ListSnapshots,DeleteSnapshots,GetCallstack,ABAPReadSyslog,ABAPReadRawSyslog,ABAPGetWPTable,ABAPAcknowledgeAlerts,ABAPGetComponentList,ABAPCheckRFCDestinations,ABAPGetSystemWPTable,ABAPSetServerInactive,J2EEGetProcessList,J2EEGetProcessList2,J2EEControlProcess,J2EEGetThreadList,J2EEGetThreadList2,J2EEGetThreadCallStack,J2EEGetThreadTaskStack,J2EEGetSessionList,J2EEGetWebSessionList,J2EEGetWebSessionList2,J2EEGetCacheStatistic,J2EEGetCacheStatistic2,J2EEGetApplicationAliasList,J2EEGetVMGCHistory,J2EEGetVMGCHistory2,J2EEGetVMHeapInfo,J2EEGetEJBSessionList,J2EEGetRemoteObjectList,J2EEGetClusterMsgList,J2EEGetSharedTableInfo,J2EEGetComponentList,J2EEControlComponents,ICMGetThreadList,ICMGetConnectionList,ICMGetCacheEntries,ICMGetProxyConnectionList,WebDispGetServerList,WebDispGetGroupList,WebDispGetVirtHostList,WebDispGetUrlPrefixList,EnqGetLockTable,EnqRemoveLocks,EnqRemoveUserLocks,EnqGetStatistic,GWCancelConnections,GWDeleteClients,GWDeleteConnections,GWGetConnectionList,GWGetClientList,UpdateSystemPKI,UpdateInstancePSE,StorePSE,DeletePSE,CheckPSE,HACheckConfig,HACheckFailoverConfig,HAGetFailoverConfig,HAFailoverToNode,HASetMaintenanceMode,HACheckMaintenanceMode,ListConfigFiles,ReadConfigFile" + } + ] + }, + "SystemReplication": null, + "Type": 2 + }, + { + "HdbnsutilSRstate": null, + "Host": "vmnwjava01", + "HostConfiguration": null, + "Name": "SCS81", + "SAPControl": { + "Instances": [ + { + "dispstatus": "SAPControl-GREEN", + "features": "GATEWAY|MESSAGESERVER|ENQUE", + "hostname": "hsonwjava", + "httpPort": 58113, + "httpsPort": 58114, + "instanceNr": 81, + "startPriority": "1" + }, + { + "dispstatus": "SAPControl-GREEN", + "features": "J2EE|IGS", + "hostname": "hsonwjava", + "httpPort": 58013, + "httpsPort": 58014, + "instanceNr": 80, + "startPriority": "3" + } + ], + "Processes": [ + { + "description": "MessageServer", + "dispstatus": "SAPControl-GREEN", + "elapsedtime": "1:46:23", + "name": "msg_server", + "pid": 16025, + "starttime": "2024 06 12 13:45:37", + "textstatus": "Running" + }, + { + "description": "EnqueueServer", + "dispstatus": "SAPControl-GREEN", + "elapsedtime": "1:46:23", + "name": "enserver", + "pid": 16026, + "starttime": "2024 06 12 13:45:37", + "textstatus": "Running" + }, + { + "description": "Gateway", + "dispstatus": "SAPControl-GREEN", + "elapsedtime": "1:46:23", + "name": "gwrd", + "pid": 16027, + "starttime": "2024 06 12 13:45:37", + "textstatus": "Running" + } + ], + "Properties": [ + { + "property": "Process List", + "propertytype": "NodeWebmethod", + "value": "GetProcessList" + }, + { + "property": "Access Points", + "propertytype": "NodeWebmethod", + "value": "GetAccessPointList" + }, + { + "property": "Parameter Documentation", + "propertytype": "NodeURL", + "value": "http://hsonwjava:58113/sapparamEN.html" + }, + { + "property": "Kernel Update", + "propertytype": "NodeURL", + "value": "https://launchpad.support.sap.com/#/softwarecenter/template/products/_APP=00200682500000001943&_EVENT=DISPHIER&HEADER=Y&FUNCTIONBAR=N&EVENT=TREE&NE=NAVIGATE&ENR=73554900100200005858&V=MAINT" + }, + { + "property": "Syslog", + "propertytype": "NodeWebmethod", + "value": "ABAPReadSyslog" + }, + { + "property": "J2EE Cluster Messages", + "propertytype": "NodeWebmethod", + "value": "J2EEGetClusterMsgList" + }, + { + "property": "Enque Locks", + "propertytype": "NodeWebmethod", + "value": "EnqGetLockTable" + }, + { + "property": "Enque Statistic", + "propertytype": "NodeWebmethod", + "value": "EnqGetStatistic" + }, + { + "property": "Gateway Connections", + "propertytype": "NodeWebmethod", + "value": "GWGetConnectionList" + }, + { + "property": "Gateway Clients", + "propertytype": "NodeWebmethod", + "value": "GWGetClientList" + }, + { + "property": "Protected Webmethods", + "propertytype": "Attribute", + "value": "ABAPAcknowledgeAlerts,ABAPCheckRFCDestinations,ABAPGetComponentList,ABAPGetSystemWPTable,ABAPGetWPTable,ABAPReadRawSyslog,ABAPReadSyslog,ABAPSetServerInactive,AnalyseLogFiles,Bootstrap,CheckParameter,CheckPSE,CheckUpdateSystem,ConfigureLogFileList,CreatePSECredential,CreateSnapshot,DeletePSE,DeleteSnapshots,EnqGetLockTable,EnqGetStatistic,EnqRemoveLocks,EnqRemoveUserLocks,GetAccessPointList,GetAlerts,GetAlertTree,GetCallstack,GetEnvironment,GetLogFileList,GetProcessParameter,GetQueueStatistic,GetStartProfile,GetSystemUpdateList,GetTraceFile,GetVersionInfo,GWCancelConnections,GWDeleteClients,GWDeleteConnections,GWGetConnectionList,GWGetClientList,HACheckConfig,HACheckFailoverConfig,HACheckMaintenanceMode,HAFailoverToNode,HAGetFailoverConfig,HASetMaintenanceMode,ICMGetCacheEntries,ICMGetConnectionList,ICMGetProxyConnectionList,ICMGetThreadList,InstanceStart,InstanceStop,J2EEControlCluster,J2EEControlComponents,J2EEControlProcess,J2EEDisableDbgSession,J2EEEnableDbgSession,J2EEGetApplicationAliasList,J2EEGetCacheStatistic,J2EEGetCacheStatistic2,J2EEGetClusterMsgList,J2EEGetComponentList,J2EEGetEJBSessionList,J2EEGetProcessList,J2EEGetProcessList2,J2EEGetRemoteObjectList,J2EEGetSessionList,J2EEGetSharedTableInfo,J2EEGetThreadCallStack,J2EEGetThreadList,J2EEGetThreadList2,J2EEGetThreadTaskStack,J2EEGetVMGCHistory,J2EEGetVMGCHistory2,J2EEGetVMHeapInfo,J2EEGetWebSessionList,J2EEGetWebSessionList2,ListConfigFiles,ListDeveloperTraces,ListLogFiles,ListSnapshots,OSExecute,ParameterValue,ReadConfigFile,ReadDeveloperTrace,ReadLogFile,ReadSnapshot,RestartInstance,RestartService,RestartSystem,SendSignal,SetProcessParameter,SetProcessParameter2,ShmDetach,Shutdown,Start,StartBypassHA,StartSystem,Stop,StopBypassHA,StopService,StopSystem,StorePSE,UpdateInstancePSE,UpdateSCSInstance,UpdateSystem,UpdateSystemPKI,WebDispGetServerList,WebDispGetGroupList,WebDispGetVirtHostList,WebDispGetUrlPrefixList,GetAgentConfig,GetListOfMaByCusGrp,GetMcInLocalMs,GetMtesByRequestTable,GetMtListByMtclass,InfoGetTree,MscCustomizeWrite,MscDeleteLines,MscReadCache,MsGetLocalMsInfo,MsGetMteclsInLocalMs,MtChangeStatus,MtCustomizeWrite,MtDbsetToWpsetByTid,MtDestroyMarkNTry,MteGetByToolRunstatus,MtGetAllToCust,MtGetAllToolsToSet,MtGetMteinfo,MtGetTidByName,MtRead,MtReset,PerfCustomizeWrite,PerfRead,PerfReadSmoothData,ReadDirectory,ReadFile,ReadProfileParameters,ReferenceRead,Register,RequestLogonFile,SnglmgsCustomizeWrite,SystemObjectSetValue,TextAttrRead,ToolGetEffective,ToolSet,ToolSetRuntimeStatus,TriggerDataCollection,Unregister,UtilAlChangeStatus,UtilMtGetAidByTid,UtilMtGetTreeLocal,UtilMtReadAll,UtilReadRawalertByAid,UtilSnglmsgReadRawdata" + }, + { + "property": "CentralServices", + "propertytype": "Attribute", + "value": "YES" + }, + { + "property": "StartPriority", + "propertytype": "Attribute", + "value": "1" + }, + { + "property": "SAPSYSTEM", + "propertytype": "Attribute", + "value": "81" + }, + { + "property": "SAPSYSTEMNAME", + "propertytype": "Attribute", + "value": "NWJ" + }, + { + "property": "SAPLOCALHOST", + "propertytype": "Attribute", + "value": "hsonwjava" + }, + { + "property": "INSTANCE_NAME", + "propertytype": "Attribute", + "value": "SCS81" + }, + { + "property": "Webmethods", + "propertytype": "Attribute", + "value": "Start,InstanceStart,StartBypassHA,Bootstrap,Stop,InstanceStop,StopBypassHA,Shutdown,ParameterValue,GetProcessList,GetStartProfile,GetTraceFile,GetAlertTree,GetAlerts,RestartService,StopService,GetEnvironment,ListDeveloperTraces,ReadDeveloperTrace,RestartInstance,SendSignal,GetVersionInfo,GetQueueStatistic,GetInstanceProperties,OSExecute,ReadLogFile,AnalyseLogFiles,ListLogFiles,GetAccessPointList,GetSystemInstanceList,GetSystemUpdateList,StartSystem,StopSystem,RestartSystem,UpdateSystem,UpdateSCSInstance,CheckUpdateSystem,AccessCheck,GetProcessParameter,SetProcessParameter,SetProcessParameter2,CheckParameter,ShmDetach,GetNetworkId,GetSecNetworkId,RequestLogonFile,CreateSnapshot,ReadSnapshot,ListSnapshots,DeleteSnapshots,GetCallstack,ABAPReadSyslog,ABAPReadRawSyslog,ABAPGetWPTable,ABAPAcknowledgeAlerts,ABAPGetComponentList,ABAPCheckRFCDestinations,ABAPGetSystemWPTable,ABAPSetServerInactive,J2EEGetProcessList,J2EEGetProcessList2,J2EEControlProcess,J2EEGetThreadList,J2EEGetThreadList2,J2EEGetThreadCallStack,J2EEGetThreadTaskStack,J2EEGetSessionList,J2EEGetWebSessionList,J2EEGetWebSessionList2,J2EEGetCacheStatistic,J2EEGetCacheStatistic2,J2EEGetApplicationAliasList,J2EEGetVMGCHistory,J2EEGetVMGCHistory2,J2EEGetVMHeapInfo,J2EEGetEJBSessionList,J2EEGetRemoteObjectList,J2EEGetClusterMsgList,J2EEGetSharedTableInfo,J2EEGetComponentList,J2EEControlComponents,ICMGetThreadList,ICMGetConnectionList,ICMGetCacheEntries,ICMGetProxyConnectionList,WebDispGetServerList,WebDispGetGroupList,WebDispGetVirtHostList,WebDispGetUrlPrefixList,EnqGetLockTable,EnqRemoveLocks,EnqRemoveUserLocks,EnqGetStatistic,GWCancelConnections,GWDeleteClients,GWDeleteConnections,GWGetConnectionList,GWGetClientList,UpdateSystemPKI,UpdateInstancePSE,StorePSE,DeletePSE,CheckPSE,HACheckConfig,HACheckFailoverConfig,HAGetFailoverConfig,HAFailoverToNode,HASetMaintenanceMode,HACheckMaintenanceMode,ListConfigFiles,ReadConfigFile" + } + ] + }, + "SystemReplication": null, + "Type": 2 + } + ], + "Profile": { + "OS_UNICODE": "uc", + "SAPDBHOST": "hana-db", + "SAPGLOBALHOST": "hsonwjava", + "SAPSYSTEMNAME": "NWJ", + "dbs/hdb/dbname": "HTJ", + "icm/HTTP/mod_0": "PREFIX=/,FILE=$(DIR_GLOBAL)/security/data/icm_filter_rules.txt", + "j2ee/dbhost": "hana-db", + "j2ee/dbname": "HTJ", + "j2ee/dbschema": "SAPJAVA1", + "j2ee/dbtype": "hdb", + "j2ee/ms/port": "3981", + "j2ee/scs/host": "hsonwjava", + "j2ee/scs/system": "81", + "service/protectedwebmethods": "SDEFAULT", + "system/type": "J2EE" + }, + "SID": "NWJ", + "Type": 2 + } + ] +} \ No newline at end of file diff --git a/test/fixtures/scenarios/sap-system-java/a18a203d-4f2f-4d21-b9a5-e300a9c5eeee_saptune_discovery.json b/test/fixtures/scenarios/sap-system-java/a18a203d-4f2f-4d21-b9a5-e300a9c5eeee_saptune_discovery.json new file mode 100644 index 0000000000..a7c0be10ce --- /dev/null +++ b/test/fixtures/scenarios/sap-system-java/a18a203d-4f2f-4d21-b9a5-e300a9c5eeee_saptune_discovery.json @@ -0,0 +1,101 @@ +{ + "agent_id": "a18a203d-4f2f-4d21-b9a5-e300a9c5eeee", + "discovery_type": "saptune_discovery", + "payload": { + "package_version": "3.1.2", + "saptune_installed": true, + "status": { + "$schema": "file:///usr/share/saptune/schemas/1.0/saptune_status.schema.json", + "argv": "saptune --format json status", + "command": "status", + "exit code": 0, + "messages": [ + { + "message": "ini.go:310: block device related section settings detected: Traversing all block devices can take a considerable amount of time.\n", + "priority": "NOTICE" + } + ], + "pid": 31089, + "publish time": "2024-06-12 15:28:31.640", + "result": { + "Notes applied": [ + "941735", + "1771258", + "2578899", + "2993054", + "1656250", + "900929" + ], + "Notes applied by Solution": [ + { + "Note list": [ + "941735", + "1771258", + "2578899", + "2993054", + "1656250", + "900929" + ], + "Solution ID": "NETWEAVER" + } + ], + "Notes enabled": [ + "941735", + "1771258", + "2578899", + "2993054", + "1656250", + "900929" + ], + "Notes enabled additionally": [], + "Notes enabled by Solution": [ + { + "Note list": [ + "941735", + "1771258", + "2578899", + "2993054", + "1656250", + "900929" + ], + "Solution ID": "NETWEAVER" + } + ], + "Solution applied": [ + { + "Solution ID": "NETWEAVER", + "applied partially": false + } + ], + "Solution enabled": [ + "NETWEAVER" + ], + "configured version": "3", + "package version": "3.1.2", + "remember message": "\n\n", + "services": { + "sapconf": [ + "disabled", + "inactive" + ], + "saptune": [ + "enabled", + "active" + ], + "tuned": [ + "disabled", + "inactive" + ] + }, + "staging": { + "Notes staged": [], + "Solutions staged": [], + "staging enabled": false + }, + "systemd system state": "running", + "tuning state": "compliant", + "virtualization": "microsoft" + } + } + } +} \ No newline at end of file diff --git a/test/fixtures/scenarios/sap-system-java/a18a203d-4f2f-4d21-b9a5-e300a9c5eeee_subscription_discovery.json b/test/fixtures/scenarios/sap-system-java/a18a203d-4f2f-4d21-b9a5-e300a9c5eeee_subscription_discovery.json new file mode 100644 index 0000000000..01393bbde7 --- /dev/null +++ b/test/fixtures/scenarios/sap-system-java/a18a203d-4f2f-4d21-b9a5-e300a9c5eeee_subscription_discovery.json @@ -0,0 +1,74 @@ +{ + "agent_id": "a18a203d-4f2f-4d21-b9a5-e300a9c5eeee", + "discovery_type": "subscription_discovery", + "payload": [ + { + "arch": "x86_64", + "expires_at": "2025-03-01 07:00:20 UTC", + "identifier": "SLES_SAP", + "starts_at": "2021-10-18 06:23:46 UTC", + "status": "Registered", + "subscription_status": "ACTIVE", + "type": "internal", + "version": "15.5" + }, + { + "arch": "x86_64", + "expires_at": "2025-03-01 07:00:20 UTC", + "identifier": "sle-ha", + "starts_at": "2021-10-18 06:23:46 UTC", + "status": "Registered", + "subscription_status": "ACTIVE", + "type": "internal", + "version": "15.5" + }, + { + "arch": "x86_64", + "identifier": "sle-module-basesystem", + "status": "Registered", + "version": "15.5" + }, + { + "arch": "x86_64", + "identifier": "sle-module-containers", + "status": "Not Registered", + "version": "15.5" + }, + { + "arch": "x86_64", + "identifier": "sle-module-desktop-applications", + "status": "Registered", + "version": "15.5" + }, + { + "arch": "x86_64", + "identifier": "sle-module-development-tools", + "status": "Not Registered", + "version": "15.5" + }, + { + "arch": "x86_64", + "identifier": "sle-module-public-cloud", + "status": "Not Registered", + "version": "15.5" + }, + { + "arch": "x86_64", + "identifier": "sle-module-sap-applications", + "status": "Registered", + "version": "15.5" + }, + { + "arch": "x86_64", + "identifier": "sle-module-server-applications", + "status": "Registered", + "version": "15.5" + }, + { + "arch": "x86_64", + "identifier": "sle-module-python3", + "status": "Registered", + "version": "15.5" + } + ] +} \ No newline at end of file From 9873c34ed166911f5a12071fd01532849dfc93c5 Mon Sep 17 00:00:00 2001 From: EMaksy Date: Tue, 30 Jul 2024 14:32:17 +0200 Subject: [PATCH 2/3] Update existing tests and add java discovery test --- .../cypress/e2e/sap_systems_overview.cy.js | 30 +++++++++++++++++-- .../available_sap_systems.js | 16 ++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/test/e2e/cypress/e2e/sap_systems_overview.cy.js b/test/e2e/cypress/e2e/sap_systems_overview.cy.js index 116707ee36..0d0d88dcea 100644 --- a/test/e2e/cypress/e2e/sap_systems_overview.cy.js +++ b/test/e2e/cypress/e2e/sap_systems_overview.cy.js @@ -2,6 +2,7 @@ import { createUserRequestFactory } from '@lib/test-utils/factories'; import { availableSAPSystems, + availableJavaSystem, isHanaInstace, isHanaPrimary, isHanaSecondary, @@ -64,7 +65,7 @@ context('SAP Systems Overview', () => { cy.url().should('include', '/sap_systems'); }); availableSAPSystems.forEach( - ({ sid: sid, attachedDatabase: attachedDatabase }) => { + ({ sid: sid, attachedDatabase: attachedDatabase, type: type }) => { it(`should show the expected attached database details`, () => { cy.get('td') .contains(sid) @@ -73,7 +74,7 @@ context('SAP Systems Overview', () => { .within(() => { cy.get('td').eq(2).contains(attachedDatabase.sid); cy.get('td').eq(3).contains(attachedDatabase.tenant); - + cy.get('td').eq(4).contains(type); cy.get('td').eq(5).contains(attachedDatabase.dbAddress); }); }); @@ -212,6 +213,31 @@ context('SAP Systems Overview', () => { }); }); }); + + describe('JAVA system discovery', () => { + before(() => { + cy.loadScenario('multi-tenant'); + cy.loadScenario('java-system'); + cy.visit('/sap_systems'); + cy.url().should('include', '/sap_systems'); + }); + + after(() => { + availableJavaSystem.instances.forEach(({ hostID }) => { + cy.deregisterHost(hostID); + }); + }); + + it(`should discover a JAVA system`, () => { + cy.get('td') + .contains(availableJavaSystem.sid) + .parent('td') + .parent('tr') + .within(() => { + cy.get('td').eq(4).contains(availableJavaSystem.type); + }); + }); + }); }); describe('SAP Systems Tagging', () => { diff --git a/test/e2e/cypress/fixtures/sap-systems-overview/available_sap_systems.js b/test/e2e/cypress/fixtures/sap-systems-overview/available_sap_systems.js index 7442054cfe..e54d651188 100644 --- a/test/e2e/cypress/fixtures/sap-systems-overview/available_sap_systems.js +++ b/test/e2e/cypress/fixtures/sap-systems-overview/available_sap_systems.js @@ -21,6 +21,7 @@ export const availableSAPSystems = [ sid: 'NWD', id: '67b247e4-ab5b-5094-993a-a4fd70d0e8d1', health: 'GREEN', + type: 'ABAP', attachedDatabase: { sid: 'HDD', id: 'f534a4ad-cef7-5234-b196-e67082ffb50c', @@ -107,6 +108,7 @@ export const availableSAPSystems = [ id: 'eb7bc03e-166f-5ed0-b22d-79672d110d04', sid: 'NWP', health: 'GREEN', + type: 'ABAP', attachedDatabase: { sid: 'HDP', id: '6c9208eb-a5bb-57ef-be5c-6422dedab602', @@ -193,6 +195,7 @@ export const availableSAPSystems = [ id: '6748d2dd-b5a1-5599-895c-d1308b2d6541', sid: 'NWQ', health: 'GREEN', + type: 'ABAP', attachedDatabase: { sid: 'HDQ', id: 'cd52e571-c897-5bba-b0f9-e155ceca1fff', @@ -276,3 +279,16 @@ export const availableSAPSystems = [ tag: 'env2', }, ]; + +export const availableJavaSystem = { + sid: 'NWJ', + type: 'JAVA', + instances: [ + { hostID: 'a18a203d-4f2f-4d21-b9a5-e300a9c5eeee' }, + { hostID: '544cbc99-c856-4b0a-88cf-e6b8db4606f6' }, + { hostID: 'c0ecf7d1-bdd3-4c29-b768-cfb97efcc585' }, + { hostID: 'e0564d66-be9e-4763-9917-655af1bb4b58' }, + { hostID: 'edf755fd-abc7-4883-af81-8b06d836db37' }, + { hostID: 'f7a8969b-db9e-4162-b82a-d5cfafe1c4e9' }, + ], +}; From 4d0875a5b3a935a8bb9ac3d8d7180d457c0dc6ef Mon Sep 17 00:00:00 2001 From: EMaksy Date: Tue, 30 Jul 2024 14:32:50 +0200 Subject: [PATCH 3/3] Add java system to demo and pr env --- .github/workflows/ci.yaml | 1 + .github/workflows/pr_env.yaml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 148f2fb872..e98fcd8b7f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -840,6 +840,7 @@ jobs: photofinish run hana-diskless-sbd -u "http://$TRENTO_DEMO_IP/api/collect" "$TRENTO_API_KEY" photofinish run multi-tenant -u "http://$TRENTO_DEMO_IP/api/collect" "$TRENTO_API_KEY" photofinish run hana-scale-up-angi -u "http://$TRENTO_DEMO_IP/api/collect" "$TRENTO_API_KEY" + photofinish run java-system -u "http://$TRENTO_DEMO_IP/api/collect" "$TRENTO_API_KEY" obs-commit-image: name: Commit to OBS to generate container image diff --git a/.github/workflows/pr_env.yaml b/.github/workflows/pr_env.yaml index 37569034b6..44db2bf3ee 100644 --- a/.github/workflows/pr_env.yaml +++ b/.github/workflows/pr_env.yaml @@ -162,4 +162,5 @@ jobs: photofinish run hana-scale-out -u "https://$TRENTO_PR_ENV_URL/api/v1/collect" photofinish run hana-diskless-sbd -u "https://$TRENTO_PR_ENV_URL/api/v1/collect" photofinish run multi-tenant -u "https://$TRENTO_PR_ENV_URL/api/v1/collect" - photofinish run hana-scale-up-angi -u "https://$TRENTO_PR_ENV_URL/api/collect" \ No newline at end of file + photofinish run hana-scale-up-angi -u "https://$TRENTO_PR_ENV_URL/api/collect" + photofinish run java-system -u "https://$TRENTO_PR_ENV_URL/api/collect" \ No newline at end of file