Command Line interface to list all warnings/criticals

I recently upgraded my installation of Nagios from 1.2 to 3.0.6 (about time, no?), and everything is finally working properly except for one thing.

In my old install, I set up a remote mail-based acknowledgement system, wherein I sent an email to the system with a certain format, and procmail processed the mail, called a script which would grep out warning and critical statuses from the status.log file, and then use the external command file to issue an acknowledgement for all criticals and warnings on the host specified in the email. Very useful system, but it was dependent on the status.log file being in a one-line-per-entry format.

As many are no doubt aware, the new status.dat is not in that format, and therefore i can either create a convoluted complex script to read the new format of the status.dat (a multiline “list of variables” format), or I can see if there’s any commands or methods for easily listing all warnings and criticals from the command line that anyone knows of. Anyone know of any?

Just to update this, I re-wrote the script to set some variables and run the status CGI file. I would still be interested in finding out if there is a command line way to query the current state other than the CGI and parsing out the html, but it’s no longer a show stopper for me…