this.snmpPort = snmpPort;
this.pingUrl = pingUrl;
}
public void init() throws Exception {
ApacheServerDiscoveryComponent discoveryComponent = new ApacheServerDiscoveryComponent();
SystemInfo systemInfo = SystemInfoFactory.createSystemInfo();
ResourceDiscoveryContext<PlatformComponent> discoveryContext = new ResourceDiscoveryContext<PlatformComponent>(
apacheServerResourceType, null, null, systemInfo, scanProcesses(systemInfo), null,
PluginContainerDeployment.AGENT);
Configuration config = discoveryContext.getDefaultPluginConfiguration();
config.put(new PropertySimple(ApacheServerComponent.PLUGIN_CONFIG_PROP_SERVER_ROOT, serverRootPath));
config.put(new PropertySimple(ApacheServerComponent.PLUGIN_CONFIG_PROP_EXECUTABLE_PATH, exePath));
config.put(new PropertySimple(ApacheServerComponent.PLUGIN_CONFIG_PROP_HTTPD_CONF, httpdConfPath));
config.put(new PropertySimple(ApacheServerComponent.PLUGIN_CONFIG_PROP_SNMP_AGENT_HOST, snmpHost));
config.put(new PropertySimple(ApacheServerComponent.PLUGIN_CONFIG_PROP_SNMP_AGENT_PORT, snmpPort));
config.put(new PropertySimple(ApacheServerComponent.PLUGIN_CONFIG_PROP_URL, pingUrl));
DiscoveredResourceDetails result = discoveryComponent.discoverResource(config, discoveryContext);
serverComponent = new ApacheServerComponent();
Resource resource = new Resource(result.getResourceKey(), null, apacheServerResourceType);
resource.setPluginConfiguration(config);