• 0
Dominique

SQL Certificates

Question

Posted (edited)

Hello,

I am trying to collect the SQL Certificates obtain by "Select name, expiry_date from sys.certificates" to have an alert when their expiration date arrived.

I tried by datasource but apparently it is not feasible after consultation with LM Support. I was directed to Property Sources but not finding my way in this new environment...

Any groowvy script to be used for that?

import com.santaba.agent.groovyapi.expect.Expect;
import com.santaba.agent.groovyapi.snmp.Snmp;
import com.santaba.agent.groovyapi.http.*;
import com.santaba.agent.groovyapi.jmx.*;
import org.xbill.DNS.*;
import groovy.sql.Sql // needed for SQL connection and query 

def hostname = hostProps.get("system.hostname"); 
import groovy.sql.Sql // needed for SQL connection and query 
def url = "jdbc:sqlserver://" + hostname + ";databaseName=master;integratedSecurity=true"; 
def driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver";  
sql = Sql.newInstance(url, driver) // connects to SQL server 
def query_result = sql.firstRow("SELECT name, expiry_date from sys.certificates") 
full_name_certificate = query_result.name
full_date_certificate = query_result.expiry_date
sql.close() // Close connection 
...

return 0;

This part looks okay but how to get the information in the Alert...

...

Thanks,

Dom

 

Edited by Dominique

Share this post


Link to post
Share on other sites

Recommended Posts

  • 1

The problem is that DataSources only take in numeric data, meaning that text data can't be included in an alert generated by a DataSource. However, there is a way to work around this since you should have lots of warning before a certificate expires, right?  Here are a couple places to start:

1. You could use groovy to calculate the number of days remaining and use that as the datapoint. You could threshold on that data and open alerts whenever it's less than 21, 14, and 7 (or whatever values you want). The value of the datapoint can easily be included in the alert message.

2. You could change the DS to be multi-instance use active discovery to discover all the certificates. Your script only uses sql.firstRow, but you could loop over sql.eachRow and output each row as an instance. You could put the expiration date as the instance description. Description can be included in the alert message. This only works because it's expected that the expiration does not change with any kind of volatility.

Share this post


Link to post
Share on other sites
  • 1

Both options i listed use DataSources. Instance level properties can only be set inside Active Discovery in a DataSource. PropertySources will only set properties on the device level. PropertySources also don't open alerts at all.

Share this post


Link to post
Share on other sites
  • 1

So close. The .eachRow is your loop statement:

import com.santaba.agent.groovyapi.expect.Expect;
import com.santaba.agent.groovyapi.snmp.Snmp;
import com.santaba.agent.groovyapi.http.*;
import com.santaba.agent.groovyapi.jmx.*;
import org.xbill.DNS.*;

import groovy.sql.Sql // needed for SQL connection and query

hostname = hostProps.get("system.hostname");
user = ''
pass = ''

SQLUrl = "jdbc:sqlserver://" + hostname + ";databaseName=master;integratedSecurity=true" //
sql = Sql.newInstance(SQLUrl, user, pass, 'com.microsoft.sqlserver.jdbc.SQLServerDriver')

sql.eachRow( 'SELECT name, expiry_date from sys.certificates'){
	println "full_name_certificate=" + it.toString()
}


sql.close() // Close connection

As for the connection string, looks like it should take this format:

jdbc:sqlserver://[serverName[\instanceName][:portNumber]][;property=value[;property=value]]

 

Share this post


Link to post
Share on other sites
  • 1
10 hours ago, Dominique said:

- Only the certificates starting by ##MS are displayed not the other ones !!! ConfigMgrEndPointCert, mirror_certificate, principal_certificate, SPOKCert and witness_certificate are not displayed!!!

That likely has to do with the output format of your script. "#" should be avoided in WILDVALUEs. You switched to scripted active discovery right? If so, then your output should be like this for each certificate:

##WILDVALUE##WILDALIAS##DESCRIPTION

So, if your WILDVALUE or WILDALIAS contain double ##, that may be screwing up the parsing of the output. I recommend a .replaceAll("#",""). 

I'm curious if you're still going the propertysource route or if you've done it in a datasource. I think it can all be done in a datasource with a datapoint that calculates the difference between now and the expiration date. Is that what you did?

Share this post


Link to post
Share on other sites
  • 1

So close again:

import com.santaba.agent.groovyapi.expect.Expect;
import com.santaba.agent.groovyapi.snmp.Snmp;
import com.santaba.agent.groovyapi.http.*;
import com.santaba.agent.groovyapi.jmx.*;
import org.xbill.DNS.*;
import groovy.sql.Sql // needed for SQL connection and query

hostname = hostProps.get("system.hostname");
user = ''
pass = ''

SQLUrl = "jdbc:sqlserver://" + hostname + ";databaseName=master;integratedSecurity=true" //
sql = Sql.newInstance(SQLUrl, user, pass, 'com.microsoft.sqlserver.jdbc.SQLServerDriver')

sql.eachRow( 'SELECT name, expiry_date from sys.certificates'){
  certname = it.name.toString().replaceAll("#","")
  println(certname + "##" + certname)
}
sql.close() // Close connection

The problem was two-fold: 1) you were not outputting in the AD format and 2) you had "##" in your certificate names, which interferes with the built in parsing mechanism that parses the output.  Make sure discovery is working properly first because the collector script will look very similar up until the println statement.

Your collection script would be very similar (assuming you've set batchscript as the collector type on the DS):

import com.santaba.agent.groovyapi.expect.Expect;
import com.santaba.agent.groovyapi.snmp.Snmp;
import com.santaba.agent.groovyapi.http.*;
import com.santaba.agent.groovyapi.jmx.*;
import org.xbill.DNS.*;
import groovy.sql.Sql // needed for SQL connection and query
import groovy.time.*

hostname = hostProps.get("system.hostname");
user = ''
pass = ''

SQLUrl = "jdbc:sqlserver://" + hostname + ";databaseName=master;integratedSecurity=true" //
sql = Sql.newInstance(SQLUrl, user, pass, 'com.microsoft.sqlserver.jdbc.SQLServerDriver')

sql.eachRow( 'SELECT name, expiry_date from sys.certificates'){
	certname = it.name.toString().replaceAll("#","")
    timetoexpire = TimeCategory.minus(new Date(),Date.parse("yyy-MM-dd HH:mm:ss.S",it.expiry_date))
    println(certname + ".daystoexpire: " + daystoexpire.getDays())
}
sql.close() // Close connection

The timetoexpire variable might need some tweaking to make sure it parses properly. This should give you collection output that looks like this (fake values):

MS_AgentSigningCertificate.daystoexpire: 23
MS_PolicySigningCertificate.daystoexpire: 45
etc.

You'd create a datapoint and set "Content the script writes to the standard output" and set Interpret output with to "multi-line key-value pairs". Then set the key to ##WILDVALUE##.daystoexpire

 

Share this post


Link to post
Share on other sites
  • 1

So, you can't change the collector once the DS has been saved, unfortunately. You will have to start a new DS to change it.

I think the problem might just be that the date coming from the sql query is somehow not a string, which the parser expects. Try casting it as a string so the parser can pick it up.

timetoexpire = TimeCategory.minus(new Date(),Date.parse("yyy-MM-dd HH:mm:ss.S",it.expiry_date.toString()))

Casting it as a string then parsing into a date may be redundant as it may be that it's already a date, but this makes sure.

Share this post


Link to post
Share on other sites
  • 1

whoops, i called the difference timetoexpire then tried to print daystoexpire. Change one to the other. 

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, Stuart Weenig said:

The problem is that DataSources only take in numeric data, meaning that text data can't be included in an alert generated by a DataSource. However, there is a way to work around this since you should have lots of warning before a certificate expires, right?  Here are a couple places to start:

1. You could use groovy to calculate the number of days remaining and use that as the datapoint. You could threshold on that data and open alerts whenever it's less than 21, 14, and 7 (or whatever values you want). The value of the datapoint can easily be included in the alert message.

2. You could change the DS to be multi-instance use active discovery to discover all the certificates. Your script only uses sql.firstRow, but you could loop over sql.eachRow and output each row as an instance. You could put the expiration date as the instance description. Description can be included in the alert message. This only works because it's expected that the expiration does not change with any kind of volatility.

Thanks Stuart.

So no need to go to "PropertySources". I will try option 2.

Thanks,

Dom

Share this post


Link to post
Share on other sites
  • 0

I will check the "DataSources" created previously as LM Support was sending me to "PropertySources" and now I am back to "DataSources"...

I attached the previous "Datasources"... I was not using this groovy script but a SQL Statement "Select name, expiry_date from sys.certificates" so I will try to change it to use a groovy script which will allow the strings...

Thanks,

Dom

2020-05-27_8-52-41 _SQL Certificates 05.png

2020-05-27_8-51-33 _SQL Certificates 04.png

2020-05-27_8-50-38 _SQL Certificates 03.png

2020-05-27_8-49-23 _SQL Certificates 02.png

2020-05-27_8-48-41 _SQL Certificates 01.png

  • Upvote 1

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

I just updated the Datasource to use the groovy script

 

2020-05-27_12-58-54 _SQL Cerificates 06 (Script).png

but the "Test Script" is giving errors:

MissingMethodException: No signature of method: groovy.sql.Sql.eachRow() is applicable for argument types: (java.lang.String) values: [SELECT name, expiry_date from sys.certificates]
Possible solutions: eachRow(java.lang.String, groovy.lang.Closure), eachRow(groovy.lang.GString, groovy.lang.Closure), eachRow(java.lang.String, groovy.lang.Closure, groovy.lang.Closure), eachRow(java.lang.String, java.util.List, groovy.lang.Closure), eachRow(java.lang.String, java.util.Map, groovy.lang.Closure), eachRow(java.util.Map, java.lang.String, groovy.lang.Closure)
com.logicmonitor.common.sse.utils.exception.ScriptExecutingFailedException: MissingMethodException: No signature of method: groovy.sql.Sql.eachRow() is applicable for argument types: (java.lang.String) values: [SELECT name, expiry_date from sys.certificates]
Possible solutions: eachRow(java.lang.String, groovy.lang.Closure), eachRow(groovy.lang.GString, groovy.lang.Closure), eachRow(java.lang.String, groovy.lang.Closure, groovy.lang.Closure), eachRow(java.lang.String, java.util.List, groovy.lang.Closure), eachRow(java.lang.String, java.util.Map, groovy.lang.Closure), eachRow(java.util.Map, java.lang.String, groovy.lang.Closure)
	at com.logicmonitor.common.sse.utils.GroovyScriptHelper.execute(GroovyScriptHelper.java:197)
	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.logicmonitor.common.sse.executor.impl.GroovyScriptHelperWrapper.execute(GroovyScriptHelperWrapper.java:86)
	at com.logicmonitor.common.sse.executor.GroovyScriptExecutor.execute(GroovyScriptExecutor.java:75)
	at com.logicmonitor.common.sse.SSEScriptExecutor$ScriptExecutingTask.call(SSEScriptExecutor.java:212)
	at com.logicmonitor.common.sse.SSEScriptExecutor$ScriptExecutingTask.call(SSEScriptExecutor.java:155)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
 elapsed time: 0 seconds

 

Checking this issue...
Edited by Dominique

Share this post


Link to post
Share on other sites
  • 0

Hello,

This script works but do not loop for all instances (all certificates!)

import com.santaba.agent.groovyapi.expect.Expect;
import com.santaba.agent.groovyapi.snmp.Snmp;
import com.santaba.agent.groovyapi.http.*;
import com.santaba.agent.groovyapi.jmx.*;
import org.xbill.DNS.*;

import groovy.sql.Sql // needed for SQL connection and query

hostname = hostProps.get("system.hostname");
user = ''
pass = ''

SQLUrl = "jdbc:sqlserver://" + hostname + ";databaseName=master;integratedSecurity=true" //
sql = Sql.newInstance(SQLUrl, user, pass, 'com.microsoft.sqlserver.jdbc.SQLServerDriver')

sql.eachRow( 'SELECT name, expiry_date from sys.certificates'){
full_name_certificate = it.toString()
}
println "full_name_certificate=" + full_name_certificate

sql.close() // Close connection

Any idea how to do the loop?

 

Thanks,
Dom

2020-05-27_16-59-15 _SQL Certificates Test by LM Support.png

Share this post


Link to post
Share on other sites
  • 0

Hello,

This script works but do not loop for all instances (all certificates!)

import com.santaba.agent.groovyapi.expect.Expect;
import com.santaba.agent.groovyapi.snmp.Snmp;
import com.santaba.agent.groovyapi.http.*;
import com.santaba.agent.groovyapi.jmx.*;
import org.xbill.DNS.*;

import groovy.sql.Sql // needed for SQL connection and query

hostname = hostProps.get("system.hostname");
user = ''
pass = ''

SQLUrl = "jdbc:sqlserver://" + hostname + ";databaseName=master;integratedSecurity=true" //
sql = Sql.newInstance(SQLUrl, user, pass, 'com.microsoft.sqlserver.jdbc.SQLServerDriver')

sql.eachRow( 'SELECT name, expiry_date from sys.certificates'){
full_name_certificate = it.toString()
}
println "full_name_certificate=" + full_name_certificate

sql.close() // Close connection

Any idea how to do the loop?

Also on the line:

SQLUrl = "jdbc:sqlserver://" + hostname + ";databaseName=master;integratedSecurity=true" 

how do you specify the SQL instance parameter to be able to get:

hostname= VRPSCCMSQL01

instance = confimgr

I need to connect to \\VRPSCCMSQL01\Configmgr

For now I have a connetion to \\VRPSCCMSQL01 ONLY!!!

 

Thanks,
Dom

Share this post


Link to post
Share on other sites
  • 0

Excellent thanks a lot Stuart.

What are the permissions for the collector towards the database I need to get the information?

On my test machine I have 'AD\svcMonLogic1' as sysadmin but could I have less permissions?

On my second machine it failed for access:

Quote

SQLServerException: Login failed for user 'AD\svcMonLogic1'. ClientConnectionId:48c07bd6-3940-4ad0-8128-9f05f57f649d
com.logicmonitor.common.sse.utils.exception.ScriptExecutingFailedException: SQLServerException: Login failed for user 'AD\svcMonLogic1'. ClientConnectionId:48c07bd6-3940-4ad0-8128-9f05f57f649d
	at com.logicmonitor.common.sse.utils.GroovyScriptHelper.execute(GroovyScriptHelper.java:197)
	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.logicmonitor.common.sse.executor.impl.GroovyScriptHelperWrapper.execute(GroovyScriptHelperWrapper.java:86)
	at com.logicmonitor.common.sse.executor.GroovyScriptExecutor.execute(GroovyScriptExecutor.java:75)
	at com.logicmonitor.common.sse.SSEScriptExecutor$ScriptExecutingTask.call(SSEScriptExecutor.java:212)
	at com.logicmonitor.common.sse.SSEScriptExecutor$ScriptExecutingTask.call(SSEScriptExecutor.java:155)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
 elapsed time: 0 seconds

 

 
Thanks,
Dom

 

Share this post


Link to post
Share on other sites
  • 0

Excellent thanks a lot Stuart.

Now I need to place an alert on the expiration date ....

What are the permissions for the collector towards the database I need to get the information?

On my test machine I have 'AD\svcMonLogic1' as sysadmin but could I have less permissions?

On my second machine it failed for access:

Quote

SQLServerException: Login failed for user 'AD\svcMonLogic1'. ClientConnectionId:48c07bd6-3940-4ad0-8128-9f05f57f649d
com.logicmonitor.common.sse.utils.exception.ScriptExecutingFailedException: SQLServerException: Login failed for user 'AD\svcMonLogic1'. ClientConnectionId:48c07bd6-3940-4ad0-8128-9f05f57f649d
	at com.logicmonitor.common.sse.utils.GroovyScriptHelper.execute(GroovyScriptHelper.java:197)
	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.logicmonitor.common.sse.executor.impl.GroovyScriptHelperWrapper.execute(GroovyScriptHelperWrapper.java:86)
	at com.logicmonitor.common.sse.executor.GroovyScriptExecutor.execute(GroovyScriptExecutor.java:75)
	at com.logicmonitor.common.sse.SSEScriptExecutor$ScriptExecutingTask.call(SSEScriptExecutor.java:212)
	at com.logicmonitor.common.sse.SSEScriptExecutor$ScriptExecutingTask.call(SSEScriptExecutor.java:155)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
 elapsed time: 0 seconds

 

 
Thanks,
Dom

 

Share this post


Link to post
Share on other sites
  • 0

Hello,

The 2nd server has the same access, so not sure what is missing

Thanks,

Dom

 

2020-05-27_18-47-15.VRPSPOKDBP1-Access.png

Share this post


Link to post
Share on other sites
  • 0

Find out I was opening both servers 1 & 2 on the same SSMS and my eyes were crossing... so no problem for the access ... working on the alerts now...

Apparently it is sending alerts for old certificates not cleaned up from the server ... expired on 02/15/2018 !!! 

How to ignore them?

Thanks,
Dom

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

2020-05-27_19-36-37 VRPSPOKDBP1 Certificates.png

All of them are expired but only the first 7 were sending alerts!!! nothing for mirror_certificate, principal_certificate, SpokCert or witness_certificate

Edited by Dominique

Share this post


Link to post
Share on other sites
  • 0
21 minutes ago, Dominique said:

2020-05-27_19-36-37 VRPSPOKDBP1 Certificates.png

All of them are expired but only the first 7 were sending alerts!!! nothing for mirror_certificate, principal_certificate, SpokCert or witness_certificate

same thing for the first servers only 7 certificates were displayed from a list of 8!!!

 

2020-05-27_19-59-15 VRPSCCMSQL01 Certificates.png

Share this post


Link to post
Share on other sites
  • 0

Hello,

let me summarize the day:

- Only the certificates starting by ##MS are displayed not the other ones !!! ConfigMgrEndPointCert, mirror_certificate, principal_certificate, SPOKCert and witness_certificate are not displayed!!!

- I am receiving alerts for certificates expired very old, not sure of the range of date they were expired e.g.: 2017 !!! How to get only the certificates which are expiring in the last 90 days or the next 90 days....

Thanks,
Dom

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

Hello Stuart,

Yes the script is in Active Directory discovery.

No more property source I deleted it. 

Yes I am using Datasource only. Does these collection impact the server performances? I noticed last night I got about 200 emails, texts and call regarding the server used for this testing... I attached one example...

I did not do any calculation in the datapoint yet as I was trying to fix the display of all certificates...

Thanks,

Dom

2020-05-28_11-20-57 VRPSCCMSQL01 Performances 01.png

Edited by Dominique
Attachment

Share this post


Link to post
Share on other sites
  • 0

Ok, looks like you're using the PropertySource output format (propertyname=value) for the ActiveDiscovery output format (certid##certdisplayname). If you can post your AD script here, I can show you what changes need to be made to get it to work.

Share this post


Link to post
Share on other sites
  • 0
import com.santaba.agent.groovyapi.expect.Expect;
import com.santaba.agent.groovyapi.snmp.Snmp;
import com.santaba.agent.groovyapi.http.*;
import com.santaba.agent.groovyapi.jmx.*;
import org.xbill.DNS.*;

import groovy.sql.Sql // needed for SQL connection and query

hostname = hostProps.get("system.hostname");
user = ''
pass = ''

SQLUrl = "jdbc:sqlserver://" + hostname + ";databaseName=master;integratedSecurity=true" //
sql = Sql.newInstance(SQLUrl, user, pass, 'com.microsoft.sqlserver.jdbc.SQLServerDriver')

sql.eachRow( 'SELECT name, expiry_date from sys.certificates'){
	println "full_name_certificate=" + it.toString()
}

sql.close() // Close connection

This is the groovy script

Thanks

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)
22 minutes ago, Stuart Weenig said:

So close again:


import com.santaba.agent.groovyapi.expect.Expect;
import com.santaba.agent.groovyapi.snmp.Snmp;
import com.santaba.agent.groovyapi.http.*;
import com.santaba.agent.groovyapi.jmx.*;
import org.xbill.DNS.*;
import groovy.sql.Sql // needed for SQL connection and query

hostname = hostProps.get("system.hostname");
user = ''
pass = ''

SQLUrl = "jdbc:sqlserver://" + hostname + ";databaseName=master;integratedSecurity=true" //
sql = Sql.newInstance(SQLUrl, user, pass, 'com.microsoft.sqlserver.jdbc.SQLServerDriver')

sql.eachRow( 'SELECT name, expiry_date from sys.certificates'){
  certname = it.name.toString().replaceAll("#","")
  println(certname + "##" + certname)
}
sql.close() // Close connection

The problem was two-fold: 1) you were not outputting in the AD format and 2) you had "##" in your certificate names, which interferes with the built in parsing mechanism that parses the output.  Make sure discovery is working properly first because the collector script will look very similar up until the println statement.

Your collection script would be very similar (assuming you've set batchscript as the collector type on the DS):


import com.santaba.agent.groovyapi.expect.Expect;
import com.santaba.agent.groovyapi.snmp.Snmp;
import com.santaba.agent.groovyapi.http.*;
import com.santaba.agent.groovyapi.jmx.*;
import org.xbill.DNS.*;
import groovy.sql.Sql // needed for SQL connection and query
import groovy.time.*

hostname = hostProps.get("system.hostname");
user = ''
pass = ''

SQLUrl = "jdbc:sqlserver://" + hostname + ";databaseName=master;integratedSecurity=true" //
sql = Sql.newInstance(SQLUrl, user, pass, 'com.microsoft.sqlserver.jdbc.SQLServerDriver')

sql.eachRow( 'SELECT name, expiry_date from sys.certificates'){
	certname = it.name.toString().replaceAll("#","")
    timetoexpire = TimeCategory.minus(new Date(),Date.parse("yyy-MM-dd HH:mm:ss.S",it.expiry_date))
    println(certname + ".daystoexpire: " + daystoexpire.getDays())
}
sql.close() // Close connection

The timetoexpire variable might need some tweaking to make sure it parses properly. This should give you collection output that looks like this (fake values):

MS_AgentSigningCertificate.daystoexpire: 23
MS_PolicySigningCertificate.daystoexpire: 45
etc.

You'd create a datapoint and set "Content the script writes to the standard output" and set Interpret output with to "multi-line key-value pairs". Then set the key to ##WILDVALUE##.daystoexpire

 

 

reviewing the error when using "Test Script"

MissingMethodException: No signature of method: static java.util.Date.parse() is applicable for argument types: (java.lang.String, java.sql.Timestamp) values: [yyy-MM-dd HH:mm:ss.S, 2020-10-21 22:15:27.0]
Possible solutions: parse(java.lang.String), parse(java.lang.String, java.lang.String), parse(java.lang.String, java.lang.String, java.util.TimeZone), wait(), clone(), any()
com.logicmonitor.common.sse.utils.exception.ScriptExecutingFailedException: MissingMethodException: No signature of method: static java.util.Date.parse() is applicable for argument types: (java.lang.String, java.sql.Timestamp) values: [yyy-MM-dd HH:mm:ss.S, 2020-10-21 22:15:27.0]
Possible solutions: parse(java.lang.String), parse(java.lang.String, java.lang.String), parse(java.lang.String, java.lang.String, java.util.TimeZone), wait(), clone(), any()
	at com.logicmonitor.common.sse.utils.GroovyScriptHelper.execute(GroovyScriptHelper.java:197)
	at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.logicmonitor.common.sse.executor.impl.GroovyScriptHelperWrapper.execute(GroovyScriptHelperWrapper.java:86)
	at com.logicmonitor.common.sse.executor.GroovyScriptExecutor.execute(GroovyScriptExecutor.java:75)
	at com.logicmonitor.common.sse.SSEScriptExecutor$ScriptExecutingTask.call(SSEScriptExecutor.java:212)
	at com.logicmonitor.common.sse.SSEScriptExecutor$ScriptExecutingTask.call(SSEScriptExecutor.java:155)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
 elapsed time: 0 seconds

The collector is "JDBC" for now, trying to change it!!

Thanks,

Dom

2020-05-28_12-44-22 _SQL Certificates Collector.png

Edited by Dominique
Add comments

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

Hello,

The error changed:

MissingPropertyException: No such property: daystoexpire for class: Script145
com.logicmonitor.common.sse.utils.exception.ScriptExecutingFailedException: MissingPropertyException: No such property: daystoexpire for class: Script145
	at com.logicmonitor.common.sse.utils.GroovyScriptHelper.execute(GroovyScriptHelper.java:197)
	at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.logicmonitor.common.sse.executor.impl.GroovyScriptHelperWrapper.execute(GroovyScriptHelperWrapper.java:86)
	at com.logicmonitor.common.sse.executor.GroovyScriptExecutor.execute(GroovyScriptExecutor.java:75)
	at com.logicmonitor.common.sse.SSEScriptExecutor$ScriptExecutingTask.call(SSEScriptExecutor.java:212)
	at com.logicmonitor.common.sse.SSEScriptExecutor$ScriptExecutingTask.call(SSEScriptExecutor.java:155)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
 elapsed time: 0 seconds

Reviewing it...

change timetoexpire to daystoexpire

Edited by Dominique

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.