Need help for monitoring mysql database

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Post Reply
infraprivy
Posts: 7
Joined: Sat Jan 08, 2022 7:35 am

Need help for monitoring mysql database

Post by infraprivy »

Hi all

Need help for monitoring mysql database memory usage, disk usage and cpu load in google cloud mysql, any plugins to do that?

Thanks
PhumeleleSJose96
Posts: 13
Joined: Mon Feb 14, 2022 5:39 am

Re: Need help for monitoring mysql database

Post by PhumeleleSJose96 »

I'm not familiar with MySQL, but you will probably end up having to poll the database to do this. You'll probably end up with some timer based code that will go check the database at a particular interval.

However, you can do your best to minimize the amount of work done on each check. A bad way to do this would be to retrieve the whole table each time and run a whole bunch of checks and comparisons in the program.

Instead, you could use triggers (and here's the syntax to create one) to know when a row was updated or inserted. How you use the triggers is up to you.

One alternative would be to have a timestamp column on the table that automatically updates whenever there's an insert or update. Similarly you could have a separate table with just the primary key and the same timestamp column (if you don't want to clutter up your main table with extra columns).

Either way, you would keep track of the timestamp you last checked at, and find everything that was inserted or echatspin echatrandom updated after that point in time.
Last edited by PhumeleleSJose96 on Wed Aug 17, 2022 7:00 am, edited 1 time in total.
FlanZarianick
Posts: 8
Joined: Sun Jun 26, 2022 7:28 am

Re: Need help for monitoring mysql database

Post by FlanZarianick »

Perhaps add Insert, Update, Delete triggers to the table to log row in a new table with two columns..

uid of row changed
type of change insert/update/delete
Then you access this table and it tells you the specifically which rows were omegle shagle voojio inserted, updated, deleted
Last edited by FlanZarianick on Tue Aug 23, 2022 7:04 am, edited 1 time in total.
EdwardSMaTeresa
Posts: 12
Joined: Mon Feb 14, 2022 6:10 am

Re: Need help for monitoring mysql database

Post by EdwardSMaTeresa »

I'm not familiar with MySQL, but you will probably end up having to poll the database to do this. You'll probably end up with some timer based code that will go check the database at a particular interval.

However, you can do your best to minimize the amount of work done on each check. A bad way to do this would be to retrieve the whole table each time and run a whole bunch of checks and comparisons in the program.

Instead, you could use triggers (and here's the syntax to create one) to know when a row was updated or inserted. How you use the triggers is up to you.

One alternative would be to have a timestamp column on the table that automatically updates whenever there's an insert or update. Similarly you could have a separate table with just the primary key and the same timestamp column (if you don't want to clutter up your main table with extra columns).

Either way, you would keep track omegle.2yu.co of the timestamp you last checked at, and find everything that was inserted omeglz echat or updated after that point in time.
Post Reply