Forum Discussion
AustinC
12 months agoNeophyte
If you’re not already doing so, I would encourage you to use the Collector Debug Facility. I am nearly certain that your problem is not due to hostProps.get() not working.
If `hostProps.get()` fails to find a given property, it will instead return a NullObject class.
Here is a test:
def testProp = hostProps.get("fake.prop");
println testProp.getClass()
Output:
class org.codehaus.groovy.runtime.NullObject
Here are a few things to look at:
- If you’re using Collector Debug:
- You must remember that ‘HostName’ must match the system.hostname property -- NOT the system.displayname property
- If you’re leveraging Auto-balanced collector groups (ABCGs), you must make certain you are debugging from the collector on which the resource is currently being polled.
- Validate each one of your variables that you are passing to your HTTP functions
- This is the most common area that I find problems with my scripting, e.g. a property isn’t being applied at the collector.
- As an aside, I believe I’ve seen some delays in properties being applied at the portal, but not yet ‘seen’ by the collectors. There is some synchronization that normally has to take place for the collector to become aware of newly-applied-properties.
- This is the most common area that I find problems with my scripting, e.g. a property isn’t being applied at the collector.
- ALL properties are read in as ‘Strings’ by default; your port _might_ need to be cast to an Integer? I don’t think this would result in a NullPointerException, however, as I think that the HTTP class you’re using should be able to cast this appropriately on the fly.
Related Content
- 5 months ago