Nagios SNMP Trap Generate Every 5 Mins

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
srikgali
Posts: 46
Joined: Thu Apr 07, 2016 9:18 am

Nagios SNMP Trap Generate Every 5 Mins

Post by srikgali »

I want to Generate SNMP Trap Every 5 minutes in Nagios, which will be send to BPPM monitoring Tool. We had already Nagios to BPPM Integration. but we want to setup heartbeat trap to BPPM to check whether Nagios Snmp is working. Can i know how can i achive it?

How can i generate SNMP Trap Every 5 Mins?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios SNMP Trap Generate Every 5 Mins

Post by tmcdonald »

Former Nagios employee
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Nagios SNMP Trap Generate Every 5 Mins

Post by ssax »

You could create a cron job that does it:

Code: Select all

*/5 * * * * root /path/to/your/script.sh

Code: Select all

#!/bin/bash

# script.sh

/usr/bin/snmptrap -v2c -cpublic 127.0.0.1 $(date +'%s') .1.3.6.1.6.3.1.1.5.1
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Nagios SNMP Trap Generate Every 5 Mins

Post by gormank »

Its pretty simple to create a command in Nagios and then a service running every 5 minutes if you really want to run it from Nagios. There's no external script--its all in Nagios. I did create a symlink to snmptrap in libexec though. The only real difference is in Nagios, the schedule is flexible and execution time will drift, while cron will run it when scheduled.

The command: $USER1$/snmptrap $ARG1$
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Nagios SNMP Trap Generate Every 5 Mins

Post by ssax »

Thanks gormank for another option, srikgali, let us know if either of those work for you.
srikgali
Posts: 46
Joined: Thu Apr 07, 2016 9:18 am

Re: Nagios SNMP Trap Generate Every 5 Mins

Post by srikgali »

Thanks For the update, This is helpful.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Nagios SNMP Trap Generate Every 5 Mins

Post by mcapra »

Awesome! Let us know if you have further questions.
Former Nagios employee
https://www.mcapra.com/
Locked