I did something similar, but instead of sending a trap to Spectrum, I sent a syslog message to a loghost. The principle is still the same. You would need to come up with a unique OID that is not in use anywhere else in your organization (possibly by creating a fictitious organization under Enterprise, "*.iso.org.dod.internet.private.enterprises*" or see http://pen.iana.org/pen/PenApplication.page to register an actual one), and have your trap OID descend from that.
Then create the event in Spectrum and map it to the OID that you created in the AlertMap. All that would be left would be to write your script and put it into CRON in the monitored server. Take a look at: - http://www.net-snmp.org/wiki/index.php/TUT:snmptrap - http://www.dachsug.ch/wiki/index.php/Event_Processing#How_to_generate_a_trap - https://communities.ca.com/web/ca-ehealth-and-ca-spectrum-global-user-community/message-board/-/message_boards/message/4943365#_19_message_2240698 - http://pen.iana.org/pen/PenApplication.page - http://www.dachsug.ch/wiki/index.php/Event_Processing Additionally, you would need a trap sender, such as net-snmp's "*snmptrap<http://www.net-snmp.org/> *" or Network Computing Technologies's "*TrapGen<http://www.ncomtech.com/trapgen.html> *". Your script might looks vaguely like: * #!/bin/ksh export directory=$1 ; cd ${directory} ; [[ $(find . -type f -print |wc -l) -gt 15 ]] && \ trapgen \ -d spectrum.example.com:162 \ -c public \ -g 6 \ -o 1.3.6.1.4.1.666.1 \ -v 1.3.6.1.4.1.666.1.0.1 STRING "More than 15 files in ${directory}" ; exit * Your crontab might look something like *0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60 * * * * countfiles.sh "/var/www"* Now mind you, this is a UNIX script, but something similar could be done for Windows, either using native tools or a port of the UNIX userland, such as the GNU clones at http://gnuwin32.sourceforge.net/. And the Windows Scheduler is a lot more slick than UNIX CRON for some tasks. On Wed, Jul 28, 2010 at 10:45 AM, Murtey, Patrick <[email protected]>wrote: > *HI David,* > > *This sounds like about the easiest solution to implement. Have you done > this before, yourself? If you have, would you mind sharing with us what a > custom OID would look like?* > > *Greatly appreciated .* > > * * > > *Patrick* > > * * > > * * > ------------------------------ > > *From:* david klein [mailto:[email protected]] > *Sent:* Tuesday, July 27, 2010 9:42 PM > *To:* Murtey, Patrick > *Subject:* Re: [spectrum] monitoring file numbers > > > > > It would occur to me to have a script run from cron, which does something > like '*cd ${directory} ; [[ $(find . -type f -print |wc -l) -gt 15 ]] && > snmptrap ${sipectrum_IP} ${cusctom_oid}*' > > > > On Tue, Jul 27, 2010 at 5:55 PM, Murtey, Patrick <[email protected]> > wrote: > > Hi All, > > > > We are running Spectrum 9.1(sp1), Ehealth 6.2, and systemedge 4.3. We > have > > been asked to try and monitor a specific directory on a server (not > > partition, or disk drive) for an excessive number of files. Can anyone > > suggest a way of doing this using the existing tools currently mentioned > > above. Excessive being 15 files in this directory, instead of 2 or 3. We > am > > aware of how to monitor disk or partition usage on a sever using Spectrum > or > > Sysedge, but an individual directory on a specific Windows partition has > us > > at a loss as how to handle this. > > > > > > > > Thanks > > > > > > > > Patrick Murtey > > > > Enterprise Management Architect > > > > MGM RESORTS Information Technology > > > > [email protected] > > > > > > > > > > > > --To unsubscribe from spectrum, send email to [email protected] with the > > body: unsubscribe spectrum [email protected] > > > > -- > > david t. klein > > Cisco Certified Network Associate (CSCO11281885) > Linux Professional Institute Certification (LPI000165615) > Redhat Certified Engineer (805009745938860) > > Quis custodiet ipsos custodes? > > > > -- david t. klein Cisco Certified Network Associate (CSCO11281885) Linux Professional Institute Certification (LPI000165615) Redhat Certified Engineer (805009745938860) Quis custodiet ipsos custodes? --- To unsubscribe from spectrum, send email to [email protected] with the body: unsubscribe spectrum [email protected]
