Insert from database

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
oz123
Posts: 42
Joined: Thu Jun 09, 2011 10:21 am

Insert from database

Post by oz123 »

Hi,

I want to update the Service Status screen manually from mysql command with a new alert. is it possible ?
what's the minimum fields to update in order to see it as an active alert ? tried something like that :

echo "use nagios; INSERT INTO nagios_servicestatus (output,notifications_enabled) VALUES ('test123','1');" | mysql -h xxxxxxxx -t -pxxxxxxx
can you send me an example ?

Thanks
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Insert from database

Post by tmcdonald »

This is not something we can recommend doing, and any damage caused to the system from manual database manipulation would not be covered by your support contract.

That being said, the command you specified should work only as far as updating what the current status is displayed as. It will not affect notifications, current status, performance data, or anything else within the Nagios process itself. This is a purely cosmetic change and will be overwritten the next time the check is run. Keep in mind, this only changes things from the point of view of the database - this does not affect what the Nagios process sees. There may also be other processes and fields in the database that might rely on that data being pristine, and modifying it outside of the Nagios process could have unintended consequences, especially if done improperly.

Once again, this is not something we can suggest or support. Continue at your own risk.
Former Nagios employee
Locked