SNMP trap issue

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
yoann3434
Posts: 6
Joined: Thu Sep 06, 2012 2:06 am

SNMP trap issue

Post by yoann3434 »

Hi everybody.
It's the first time I come in this forum and I need help.

I explain me.
I have installed the latest NagiosXI and now I need to implement SNMP Trap to use owner MIBs. Thuf I follow this tutorial http://assets.nagios.com/downloads/nagi ... ith_XI.pdfand when I want to run this CLI #./NagiosXI-SNMPTrap.sh I have this message error :
./NagiosXI-SNMPTrap.sh: line 1: syntax error near unexpected token `newline'
./NagiosXI-SNMPTrap.sh: line 1: `<HTML>'
:?:
So I don't know How can I alter this file.
Is there someone who have got this scrip working?

Thank you before.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: SNMP trap issue

Post by scottwilkerson »

Can you run the following and post the output because I believe you don't have the correct file

Code: Select all

cat ./NagiosXI-SNMPTrap.sh
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
yoann3434
Posts: 6
Joined: Thu Sep 06, 2012 2:06 am

Re: SNMP trap issue

Post by yoann3434 »

Hi, thank for your reply.

So I have made nano over the file and it began by this=>

<HTML>
<HEAD>
<META http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Blocked URL</title>
</HEAD>

<BODY bgcolor="white">
<div style="text-align:center"><img id="inlineimage" alt=0 src="data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABHNCSVQICAgIfAhk...

I find realy strange that NagiosXI-SNMPTrap.sh is a html file inside instead a shell ...???

????
yoann3434
Posts: 6
Joined: Thu Sep 06, 2012 2:06 am

Re: SNMP trap issue

Post by yoann3434 »

Hi, thank for you reply.

Yes it's exactly what I think because the script is an html code and not in shell

HTML
HEAD
META http-equiv="Content-type" content="text/html; charset=utf-8">
title>Blocked URL title>
HEAD>

BODY bgcolor="white">
div style="text-align:center"> img id="inlineimage" alt=0 src="data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABHNCSVQICAgIfAhk

I have vanish the first chevron to evoid problem code sending.

Do you know where can I found the good file? I have upload it to http://assets.nagios.com/downloads/nagi ... NMPTrap.sh

???
yoann3434
Posts: 6
Joined: Thu Sep 06, 2012 2:06 am

Re: SNMP trap issue

Post by yoann3434 »

I don't understand how work this forum, It's the third reply I try to send.

So I said there is html code inside the file and not shell code.
Do you know where can I upload the good file?

thank before.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: SNMP trap issue

Post by scottwilkerson »

My guess is that your proxy server is blocking the URL

You can download it directly and transfer it to your server and overwrite the bad one
You do not have the required permissions to view the files attached to this post.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
yoann3434
Posts: 6
Joined: Thu Sep 06, 2012 2:06 am

Re: SNMP trap issue

Post by yoann3434 »

Hey, Thank you. I have see it in same time you have send me your reply.
Now it's work. :P
Or not. I have a bugg message :o

Loaded plugins: fastestmirror, security
Determining fastest mirrors
YumRepo Error: All mirror URLs are not using ftp, http or file.
Eg. </HTML>/
removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: base
./NagiosXI-SNMPTrap.sh: line 27: bzr: command not found
./NagiosXI-SNMPTrap.sh: line 28: bzr: command not found
./NagiosXI-SNMPTrap.sh: line 29: bzr: command not found
--2012-09-07 07:24:25-- http://superb-sea2.dl.sourceforge.net/p ... tt_1.3.tgz
Resolving superb-sea2.dl.sourceforge.net... 209.160.57.180
Connecting to superb-sea2.dl.sourceforge.net|209.160.57.180|:80... connected.
HTTP request sent, awaiting response... 202 Request for blocked URL
Length: unspecified [text/html]
Saving to: âsnmptt_1.3.tgzâ

[ <=> ] 12,644 --.-K/s in 0.003s

Last-modified header invalid -- time-stamp ignored.
2012-09-07 07:24:25 (4.27 MB/s) - âsnmptt_1.3.tgzâ


gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
./NagiosXI-SNMPTrap.sh: line 36: cd: snmptt_1.3: No such file or directory
cp: cannot stat `snmptt': No such file or directory
cp: cannot stat `snmptt.ini': No such file or directory
cp: cannot stat `snmptt-init.d': No such file or directory
cp: cannot stat `snmpttconvertmib': No such file or directory
./NagiosXI-SNMPTrap.sh: line 41: bzr: command not found
sed: can't read /etc/rc.d/init.d/snmptt: No such file or directory
./NagiosXI-SNMPTrap.sh: line 44: bzr: command not found
./NagiosXI-SNMPTrap.sh: line 47: bzr: command not found
sed: can't read /etc/snmp/snmptt.ini: No such file or directory
...........
./NagiosXI-SNMPTrap.sh: line 220: bzr: command not found
./NagiosXI-SNMPTrap.sh: line 225: bzr: command not found
./NagiosXI-SNMPTrap.sh: line 231: bzr: command not found
Stopping snmptrapd: pidof: invalid options on command line!

pidof: invalid options on command line! [FAILED]

I don't know if pidof is realy usefull.
Can you light me please?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: SNMP trap issue

Post by scottwilkerson »

It looks like your yum repositories are all screwed up too... Likely because your proxy server as well...
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
yoann3434
Posts: 6
Joined: Thu Sep 06, 2012 2:06 am

Re: SNMP trap issue

Post by yoann3434 »

Hi, thanks again. I go and see my proxy prameters. It's problably the issue because I'm new hire in enterprise. I will look for with the other administrator.
Locked