NagiosEnterprises / nagioscore

Nagios Core
GNU General Public License v2.0
1.58k stars 451 forks source link

Feature Request: Pass external commands to query handler #364

Open nook24 opened 7 years ago

nook24 commented 7 years ago

Would be great to add a way to pass external commands to the nagios.qh. Query hander is a much saver way to pass data to nagios, because if nagios dies you get a "Connection refused" or some other error instead of creating a 10GB nagios.cmd text file on disk. In addition, the query handler would be able to tell you if your command was processed successfully and you can continue with the next command. So you will not "DDoS" the core by passing many commands at once to nagios.

jfrickson commented 7 years ago

Sounds like a great idea. I'll look into it.

nook24 commented 7 years ago

@jfrickson I want to mention that's not my idea. It was implemented to the Naemon Project ~two years ago.

https://github.com/naemon/naemon-core/blob/master/src/naemon/query-handler.c#L327-L363 To pass a command, you simply send

#command run [1495091072] PROCESS_SERVICE_CHECK_RESULT;host1;service1;0;OK- Everything Looks Great\0

to the query handler socket. If the command was processed successfully the query handler respond with 200: OK

hedenface commented 7 years ago

Added to 5. We were looking into an advanced query utility included in that version, this fits right along with that.

allwyn-pradip commented 2 years ago

bumping this request.