Hi Hannu<br><br>Thanks a lot for the information you provided.<br>I still have some issues in the services.cfg file<br>i have pasted it below, i get this error in cgi<br>Status information:CRITICAL: Passive Service check is missing!<br>If i set the check_period none nagios does not start.<br>Please advice<br><br>define service{<br> name generic-service <br> active_checks_enabled 0 <br> passive_checks_enabled 1 <br>
parallelize_check 1 <br> obsess_over_service 1 <br> check_freshness 0 <br> notifications_enabled 1 <br> event_handler_enabled 1 <br> flap_detection_enabled
1 <br> failure_prediction_enabled 1 <br> process_perf_data 1 <br> retain_status_information 1 <br> retain_nonstatus_information 1 <br> register 0 <br> retry_check_interval
1<br> }<br><br><br> <br>define service{<br>
register 0<br> name passive-check-template<br> use generic-service<br> check_freshness 1<br> check_period
none<br> passive_checks_enabled 1<br> max_check_attempts 1<br> check_command passive_check_missing<br> notification_interval 120<br> notification_period 24x7<br> notification_options w,c,r<br> freshness_threshold
600<br>}<br> <br><br><br>define service {<br> use passive-check-template<br> host_name node<br> contact_groups
admins<br> service_description snmp_trap_handling_ok<br> register 1<br> normal_check_interval 2<br> retry_check_interval 2<br> check_period 24x7<br>}<br><br>Regards<br>Vinod Moraes<br><br><br><b><i>Hannu Liljemark <hannu.liljemark@gstdomain.net></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> On Wed, May 31, 2006 at 12:39:47AM -0700, Vinod wrote:<br><br>> I tried to configure nagios to listen to snmp traps from a host.<br>> i have been referring to documents<br>> http://www.samag.com/documents/s=9559/sam0503g/<br>> http://www.snmptt.org/docs/snmptt.shtml#Integration-with-other-software<br><br>I've been using http://www.samag.com/documents/s=9559/sam0503g/ with<br>good success.<br><br>> Secondly<br>>
http://www.samag.com/documents/s=9559/sam0503g/<br>> speicifes <br>> use passive-check-template<br>> but its not mentioned how to define the passive-check-template<br><br>You can define passive_check_missing in checkcommands.cfg,<br>although it wont be used in this case:<br><br>define command{<br> command_name passive_check_missing<br> command_line $USER1$/passive_check_missing.sh<br> }<br><br><br>Here's what passive_check_missing.sh looks like:<br><br>#!/bin/sh<br><br>/bin/echo "CRITICAL: Passive Service check is missing!"<br><br>exit 2<br><br><br>In services.cfg we define the template that will be used by the<br>snmp_trap_handling_* service checks:<br><br>define service{<br> register 0<br> name passive-check-template<br> use generic-service<br> check_freshness 1<br> check_period none<br>
passive_checks_enabled 1<br> max_check_attempts 1<br> check_command passive_check_missing<br> freshness_threshold 600<br>}<br><br><br>I've been converting mibs with:<br><br>snmpttconvertmib --net_snmp_perl --format_desc=6 --in=FOO.mib \<br>--out=/etc/snmp/snmptt-FOO.conf<br><br>as that seems to produce EVENTs with descriptions making more<br>sense than the default convert shown in the article. You may want<br>to look though them anyway or replace 6 with smaller number.<br>Check 'snmpttconvermib --help' for more info.<br><br>I've also made a small change to the snmptraphandling.py. Trend<br>Micro's MIBs use the severity NORMAL when snmptraphandling.py<br>only matches Normal (case sensitive). So I've added a section<br>to also match NORMAL.<br><br>My sec.conf looks
like:<br><br>type=Single<br>ptype=RegExp<br>pattern=(\w+\s+\d+\s\d+:\d+:\d+)\s[\w\.\-]+\ssnmptt\[\d+\]:\s\<br>([\d\.]*)\s(Normal|NORMAL|INFORMATIONAL|MINOR|WARNING|SEVERE|\<br>MAJOR|CRITICAL)\s\"Status Events\"\s([\w\.\-]*)\s\-\s(.*)<br>desc=snmptrap received from $3<br>action=shellcmd /opt/nagios/libexec/eventhandlers/snmptraphandling.py\<br> $4 $3 "$5"<br><br>When converting MIBs, you also may want to check them<br>through to see what kind of severities are defined for various traps.<br>So far there seems to a lot of Normal severity traps even for traps<br>that alert you about hardware failures etc. The article says "One<br>of the beauties of this solution is that we can use the event severity<br>set by the mib designer. Nagios will always report the event status<br>based on this information." and I think this is somewhat problematic<br>with a lot of MIBs. Many traps seem to define the severity somewhere<br>else.<br><br>Lets take examples from SUN-PLATFORM-MIB. Some Sun
server might<br>send alarm traps and these have Normal severity so snmptt + sec + Nagios<br>would map them to OK. However they might be something worse: component<br>has blown up or system is reaching temperatures where metal starts<br>to melt... so I guess this setup has some drawbacks.<br><br>EVENT sunPlatEquipmentAlarm .1.3.6.1.4.1.42.2.70.101.2.0.5\<br> "Status Events" Normal<br>EVENT sunPlatEnvironmentalAlarm .1.3.6.1.4.1.42.2.70.101.2.0.4\<br> "Status Events" Normal<br><br>You get the severity as a variable:<br><br> 7: sunPlatNotificationPerceivedSeverity<br> Syntax="INTEGER"<br> 1: indeterminate<br> 2: critical<br> 3: major<br> 4: minor<br> 5: warning<br> 6: cleared<br> Descr="The perceived severity of the alarm, as specified by<br> the agent that generated it in accordance with X.733,<br> sec. 8.1.2.3."<br><br>I'd be interesting in hearing from others if they've come up with<br>some solution to this, or
if I've misunderstood something.<br><br>Regards,<br><br>-- <br>Hannu Liljemark | Appelsiini Finland Oy | http://appelsiini.fi<br><br><br>_______________________________________________<br>Nagios-users mailing list<br>Nagios-users@lists.sourceforge.net<br>https://lists.sourceforge.net/lists/listinfo/nagios-users<br>::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. <br>::: Messages without supporting info will risk being sent to /dev/null<br></blockquote><br><p> __________________________________________________<br>Do You Yahoo!?<br>Tired of spam? Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com