complicated question....
complicated question....
Is there any way to make a script (or cronjob) or something that could log into a machine and run a command, then take the text output of that command and sort it into an mysql database from which say an MRTG graph of the data could be made?
Like you said, you can schedule the task with cron.
You can login remotely into a machine and run a command with ssh (see `man ssh' for details):
ssh user@hostname command
edit: To avoid an interactive password prompt in your cron script, you will need to set up public/private key authentication (see Google for details).
With your remote command, use Unix pipes to take a first program's output as the input of a second.
You will have to write the second program, parse the inputted text with it, and insert the data into the database with it, so choose your favorite scripting language with regular expressions and MySQL bindings (python or perl would be good choices).
To make a pretty plot, you can have your second program also generate gnuplot script and then pipe that to a third program--gnuplot.
edit: Then scp (see `man scp') the plot from the remote server back locally. (You could vary this order somewhat, i.e., write the first program's output to a text file, scp that back locally, and then run the second and third programs locally, etc.)
You can login remotely into a machine and run a command with ssh (see `man ssh' for details):
ssh user@hostname command
edit: To avoid an interactive password prompt in your cron script, you will need to set up public/private key authentication (see Google for details).
With your remote command, use Unix pipes to take a first program's output as the input of a second.
You will have to write the second program, parse the inputted text with it, and insert the data into the database with it, so choose your favorite scripting language with regular expressions and MySQL bindings (python or perl would be good choices).
To make a pretty plot, you can have your second program also generate gnuplot script and then pipe that to a third program--gnuplot.
edit: Then scp (see `man scp') the plot from the remote server back locally. (You could vary this order somewhat, i.e., write the first program's output to a text file, scp that back locally, and then run the second and third programs locally, etc.)