PropertySources - Windows Service / FTP Site
Hi,
I created two new PropertySources and you are welcome to use them or as an example:
This one will check if a FTP service was installed on Windows machine, and if yes, will create auto properties name FTPService
hostname=hostProps.get("system.hostname");
my_query="Select name FROM Win32_Service where Name ='ftpsvc'"
import com.santaba.agent.groovyapi.win32.WMI;
import com.santaba.agent.groovyapi.win32.WMISession;
def session = WMI.open(hostname);
def obj = session.queryFirst("CIMv2", my_query, 10);
if (obj.NAME == "ftpsvc") {
println "FTPService=Yes"
}
return 0
This one will check if a FTP site was configured inside the IIS on Windows machine, if yes, will create auto properties name FTPSite
hostname=hostProps.get("system.hostname");
my_query="Select name FROM Site where Name like '%FTP%'"
import com.santaba.agent.groovyapi.win32.WMI;
import com.santaba.agent.groovyapi.win32.WMISession;
def session = WMI.open(hostname);
def obj = session.queryFirst("WebAdministration", my_query, 10);
if (obj.NAME =~ "FTP") {
println "FTPSite=Yes"
}
return 0
Using the PropertySources, you can target data sources or you can filter a group of computers
Good luck