monitoring mongodb and mysql replications using nagios
For MongoDB, this would be a good place to start:

https://github.com/mzupan/nagios-plugin-mongodb

It's python rather than PHP, but it's basically what you are looking for to get the data into Nagios.  Then for what to monitor and alert on, I've previously written up a quick summary of this plugin previously on the mongodb-user group:

https://groups.google.com/forum/#!topic/mongodb-user/bix36VvywXE/discussion