-
BUG? include in config file not working
I wanted to consolidate all my modules into a separate config file so I took working modules and cut and pasted them into a new config file. I added a line in pandora_agent.conf to include the new file.
It does not work. On a new agent the module never appears in the console, on one that was working the module goes into unknown state.
As per usual, the log file shows nothing of any use, no errors.
Found the problem. The code for opening the include file doesn’t log any error if it can’t find or open the file. Any failure fails silently. My include file had a misspelling which was obvious once I’d modified the source code from “or next” to “or die” and ran the agent directly in the console which forced it to spit out a useful error message.
Silently failing and not logging seems very poor practice to me as a non programmer, I spent far more time tracking this down than I should have done due to this.