I'm looking for something like Cacti or Zabbix, but driven from a command line.
I hate clicking, I like scripting and shell automagic. I'm looking for some monitoring suite that would allow me to edit host list, alerts, etc. using Emacs/Vim.
Any ideas/links are appreciated.
Nagios
Like Nick said, Nagios is your app. I'm pretty sure all the graphical monitoring systems draw inspiration from Nagios. Many of them simply put a GUI on top of Nagios configuration.
But you are going to hate maintaining the multiple interdependent config files in Nagios. You'll definitely need some kind of version control to roll back when you make a mistake, and draw lots of diagrams to remind yourself what you did. Max Schubert et al's book Nagios 3 Enterprise Network Monitoring will be of great use if you go for this.
But despite all the challenges Nagios rocks!
well, there is a commandline tool to configure zabbix - zabcon, although it currently only supports a very small subset of configuration changes. not really configurable by editing textfiles, but could be pretty neat if development continues.
http://trac.red-tux.net/wiki/zbx_api/zabcon