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
Andrey_Kitsen
·9 years agoAwesome.
Share that locator ID for others to try it out.
Idan
OP9 years agoHi Andrey
This is done now
Andrey_Kitsen
·9 years agoHey @Idan thanks for the sharing your propertySource.
For easier sharing & importing of datasources, submit the datasource to the LogicMonitor Exchange and a locator ID will be generated. This way, there is no need to copy and paste.
See https://www.logicmonitor.com/support/settings/logicmodules/lm-exchange/ for guidance.
Thanks!
Idan
OP9 years agoOne small comment,
The scripts and the names are case sensitive