I'm looking for a Management Information Base (MIB) designed for web applications (Note: I'm working in PHP) that I can send multiple variables to my Network Management System via an SNMP Trap. Do I have to design one or is there a solution out there already?
More details:
Basically I want to send a trap to my Network Management System (Zenoss) whenever there is an error on my web application. I would like to call it in PHP like the following (note: this syntax might not be correct):
(Note: obviously, BOSSJONES-NOTIFICATION
does not exist; I'm just using it for this example. I'd like to replace it with the MIB I'm looking for, or the one that needs to be designed.)
<?php
const SNMPTRAP = '/usr/bin/snmptrap';
$host = 'zenoss.bossjones.com';
if ( some_random_error() ) {
exec( SNMPTRAP . ' -v 2c -c public -L e ' . $host .
' "" BOSSJONES-NOTIFICATION::snmpErrorNotification' .
' device s "192.168.1.121" errorType s "image upload fail"' .
' errorCode i 340 errorMessage s "Could not upload image at path' .
' /path/to/image/blah.gif" ' );
}
I understand that the MIB might not have the same parameters, of course, but I'm wondering if theres a general solution out there that I can either "make do with" or learn from, so that I can create my own that works for my purposes?
Also, is it possible to send a list of info (like an array) rather than just multiple strings via a trap?
Sorry for the long question. Wanted to provide as much details as possible.
(PS: Running on a Ubuntu 11.04 Linux box)