Tell us how you run that external program outside of Emacs, and we can show you how to run it inside Emacs.
Then it's just a matter of timers and a variable in your mode-line-format. Note that your variable will need the risky-local-variable
in order to show text properties (for the colour). See C-h i g (elisp)Mode Line Data
and/or C-h i g (elisp)Properties in Mode
.