-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error getting probe properties #374
Comments
Hi @kbilsted, Just prior to calling client.LogLevel = LogLevel.Request | LogLevel.Response;
client.LogVerbose (sender, args) => {
Console.WriteLine(args.Message);
}; and then provide the resulting XML output. Please check there is no sensitive information in the output prior to posting |
I get the following output
not sure it really helps me much. The problem im trying to solve is to figure out what is the url used in my http probe and how can i change this url from your api-library. I figured since the information was not available in the Not sure if it is relevant, but alternatively to logging, you can add data to exceptions by changing
to
|
Ah, I see the issue! var props =client.GetProbeProperties(sensor.Id); You are attempting to retrieve the probe properties of a sensor To retrieve sensor properties you must use Additionally, if the property you want isn't defined on the object emitted from |
Also, I can't believe I never tested this before, but I don't think my Sensor[] sensors = client.QuerySensors(s=>s.Name.ToLower().Contains("myservice")).ToArray(); From a quick test I think this will result in pulling all sensors from the server, and then filtering client side. On this basis it might be best to retrieve sensors normally //The Contains operator is case insensitive
client.GetSensors(Property.Name, FilterOperator.Contains, "myservice"); |
OMG! What a silly mistake! Sorry for wasting your time on that. hmm.. oh!.. this was just a test to see the rigor of your error handling... :-) I am not sure it makes sense, but why do we not first fetch the object and check the type to see that it is compatible with the operation we are doing? If it takes too much time, perhaps an extra parameter can be added turning this behaviour on/off. or maybe do it in some introduced exception handling. |
Many thanks, i believe you are correct, the query takes a very long time! Can the filter-operations you suggest be specified as case insensitive? We have a mix of manually created probes over the last decade, so you will find all sorts of mess in there. |
If <div class="errormsg"><p>PRTG Network Monitor has discovered a problem. Your last request could not be processed properly.</p>
<h3>Error message: The selected object cannot be used here.</h3> In this case, this failed because there is a bug in PrtgAPI's parsing of this error message. If PrtgAPI had been able to parse this message properly, it would have been a lot easier to see the reason that your call to |
My experience is that when exactly one filter is specified, |
Hi Milko Yes the tradeof is twice the number of requests. Perhaps that is a very low overhead? Perhaps it is ok when exceptions are thrown? Perhaps a simple error text telling the user to double check the types manually. btw I keep writing probe when i mean sensor. :-) |
Extracting all of our sensors i get more deserialization errors. PrtgAPI.XmlDeserializationException
the log file does not contain |
It sounds like PRTG has added a new GraphType that is not known to PrtgAPI. You can work around this for now by doing |
Are you interested in a data dump so the parser can be extended to support the new types? |
Describe the bug
using the api for the first time i can get probe information, but an exception is raised when getting properties
Steps to reproduce
What is the output of 'Get-PrtgClient -Diagnostic'?
Additional context
No response
The text was updated successfully, but these errors were encountered: