ContributionsMost RecentMost LikesSolutionsRe: API ingest from UltraDNS into Logic Monitor Can you provide me with an example of how I would need to construct that? Apologies for asking, but I see to be the only one on my team that's ever had to make this kind of request to UltraDNS. Re: API ingest from UltraDNS into Logic Monitor Ok so the first issue I have to overcome is that I have to perform a POST for the bearer token to a URL that I can provide via DM. Then once I get that POST response, that is my token (along with my userID, pwd and acct# that I have to pass as part of my GET (or can be in the body of the request, whichever way works best.) If I can get that to work, then the ingest of the data shouldnt be a huge issue. I hope that makes sense. UltraDNS doesn't just have a simple auth process when it comes to their API. I wish it were a simple un/pwd combo, but it's MFA, so they need the bearer token (or in our case ... a refresh Token) to pass to them for auth. Re: API ingest from UltraDNS into Logic Monitor The problem here being that I need to be able to gather this information without a collector. UltraDNS is expecting me to be able to pull this information from an API call, which I can do. I want to be able to ingest that information into LM with that call via my API and have LM ingest that data, but it appears that the methods of auth may or may not work between the two end points. Michael, For the payload, the parameter values would be my auth token I'm assuming? They do have an expiry on the initial bearer token but we do have the ability to supply a refresh token that extends beyond the expiry of the initial bearer token. Re: API ingest from UltraDNS into Logic Monitor No because this isn't a collector. I've reviewed the documentation on how to set up a collector for debug purposes and in this case, it may not apply to what I'm trying to do. Re: API ingest from UltraDNS into Logic Monitor I tried that with that same auth failure. Re: API ingest from UltraDNS into Logic Monitor Stuart, in my GET from them, I am passing a bearer token along with the param for our account name. Here's how I've updated my script: import com.santaba.agent.groovyapi.http.*; // instantiate an http client object for the target system ip="api.ultradns.com" httpClient = HTTP.open(ip, 443); user = hostProps.get("ultradns.user"); pass = hostProps.get("ultradns.pass"); account = hostProps.get("ultradns.accountName"); // use an authentication API call to initiate a session // specify the url to which we want to post url = "https://"+ip+"/authorization/token"; def payload = '{"username":"myusername","typeId":"com.tintri.api.rest.vcommon.dto.rbac.RestApiCredentials","password":"mypassword"}'; // do the post def postResponse = httpClient.post(url, payload,["Content-Type":"application/json"]); // does the response indicate a successful authentication? if ( !(httpClient.getStatusCode() =~ /200/) ) { // no -- report an error, and return a non-zero exit code println "authentication failure"; return(1); } // we are now authenticated. Subsequent GETs with the httpClient will pass in the session cookie url="https://"+ip+"/reports/dns/usage_summary"; def getResponse=httpClient.get(url); // print some data println httpClient.getResponseBody(); Re: API ingest from UltraDNS into Logic Monitor Ok I fixed that but now I'm getting an auth error. I verified my user name and password and those both work, but I believe that Ultra is looking for a bearer token to pass to it as part of the auth process. This is what I have to pass into Ultra as part of my auth process. This is my POST to them. "refresh_token": "xxxxxxxx", "access_token": "xxxxxxxxx", Info obscured for security reasons. Re: API ingest from UltraDNS into Logic Monitor Ah, I see. I fixed that issue and now get this error: The script failed, elapsed time: 0 seconds - No such property: HTTP for class: Script2340 groovy.lang.MissingPropertyException: No such property: HTTP for class: Script2340 at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:66) at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:51) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:310) at Script2340.run(Script2340.groovy:3) Re: API ingest from UltraDNS into Logic Monitor The embed groovy script syntax is illegal - startup failed: Script303.groovy: 11: expecting ''', found '\r' @ line 11, column 88. tri.api.rest.vcommon.dto.rbac. ^ 1 error org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script303.groovy: 11: expecting ''', found '\r' @ line 11, column 88. tri.api.rest.vcommon.dto.rbac. ^ 1 error at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310) at org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:150) at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:120) at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:132) at org.codehaus.groovy.control.SourceUnit.addError(SourceUnit.java:349) at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:220) at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:191) at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:233) at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:189) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:966) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:626) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:602) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:579) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:323) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:293) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:677) at groovy.lang.GroovyShell.parse(GroovyShell.java:689) at groovy.lang.GroovyShell.parse(GroovyShell.java:725) at groovy.lang.GroovyShell.parse(GroovyShell.java:716) Stuart, Above are the error messages we receive when I run the test script. Thank you again for your assistance. Re: API ingest from UltraDNS into Logic Monitor Stuart, What we are attempting to monitor is the amount of DNS queries we receive per month. The output of that report shows us rough numbers, but we start to incur costs after 65 million. We're trying to set up an alert that notifies us when we get to approx 62 million so that will be our threshold. The code I sent above presents me with all kinds of errors when I'm building it though so I'm not sure what I'm missing. If you'd like I can post you a screen shot of the errors I get when I try to test that code in LM.
Top ContributionsRe: API ingest from UltraDNS into Logic MonitorRe: API ingest from UltraDNS into Logic MonitorRe: API ingest from UltraDNS into Logic MonitorRe: API ingest from UltraDNS into Logic MonitorRe: API ingest from UltraDNS into Logic MonitorRe: API ingest from UltraDNS into Logic MonitorRe: API ingest from UltraDNS into Logic MonitorRe: API ingest from UltraDNS into Logic MonitorRe: API ingest from UltraDNS into Logic MonitorRe: API ingest from UltraDNS into Logic Monitor