Sending info to mysql db

biteriu

New Member
Joined
Oct 31, 2020
Messages
2
Reaction score
0
Credits
28
Hello,

I want to make a script that monitorizes the cpu utilization and sends that data to a mysql database. I have two VMs made with ORACLE, they both can comunicate with eachother, I made a script using the top command on VM1 and on the VM2 I have installed myqsl server. I only found how to send the information from the top command to an email, how can I send it to be stored in the mysql db?

Thank you!
 


I can't tell you exactly how to do it but here are the steps:
- look at the top output and devise the table schema to hold the data
- define the table with the schema (layout) in MySql
- on the monitoring machine, save monitor data into a file
- write a script that opens a connection to the remote MySql server, opens your file of monitor data, then performs a database load using the file contents as input. This will involve something like
- loop through file
- foreach record
- parse each token​
- load tokens into SQL load statement​
- execute the SQL load command​
That's the general approach I think....

keith
 

Staff online

Members online


Top