Page 6 of 7

Re: Problems with Hosts

Posted: Wed Sep 12, 2012 4:30 pm
by scottwilkerson
you did create the UCD-TRAP-TEST-MIB.txt correct?

Are you testing this from your Nagios Server?

Re: Problems with Hosts

Posted: Wed Sep 12, 2012 4:52 pm
by shakra2005
this is my trap

D-TRAP-TEST-MIB DEFINITIONS ::= BEGIN
IMPORTS ucdExperimental FROM UCD-SNMP-MIB;

demotraps OBJECT IDENTIFIER ::= { ucdExperimental 990 }

demoTrap TRAP-TYPE
ENTERPRISE demotraps
VARIABLES { sysLocation }
DESCRIPTION "An example of an SMIv1 trap"
::= 17

END

and i am running that from my nagios server

CISCO:

Return code of 126 is out of bounds - plugin may not be executable)

This is showing on any monitoring device that tries to monitor port bandwidth.

I have this error showing up when i try and monitor both watch guard and cisco switches.

Any ideas which plugin/ plugin location would be causing the issue?

Re: Problems with Hosts

Posted: Thu Sep 13, 2012 7:41 am
by scottwilkerson
Run

Code: Select all

chmod +x /usr/local/nagios/libexec/check_rrdtraf

Re: Problems with Hosts

Posted: Thu Sep 13, 2012 7:52 am
by shakra2005
now the service check is running :-)


Is my test trap mib correct ?

Re: Problems with Hosts

Posted: Thu Sep 13, 2012 11:01 am
by scottwilkerson
shakra2005 wrote:Is my test trap mib correct ?
No, the MIB should look like this

Code: Select all

UCD-TRAP-TEST-MIB DEFINITIONS ::= BEGIN
IMPORTS ucdExperimental FROM UCD-SNMP-MIB;
demotraps OBJECT IDENTIFIER ::= { ucdExperimental 990 }
demoTrap TRAP-TYPE
ENTERPRISE demotraps
VARIABLES { sysLocation }
DESCRIPTION "An example of an SMIv1 trap"
::= 17
END
Then you will need to restart the services

Re: Problems with Hosts

Posted: Thu Sep 13, 2012 3:01 pm
by shakra2005
No log handling enabled - turning on stderr logging
SNMPv2-MIB::syslocation.0: Unknown Object Identifier

hast anyone a sample config for me ?

Re: Problems with Hosts

Posted: Mon Sep 17, 2012 4:47 am
by shakra2005
snmptt is running on localhost. Now i have created the Database snmptt with the tables snmptt, snmptt_statistics, snmptt_unknown

CREATE TABLE snmptt.snmptt_unknown (
id mediumint(9) NOT NULL auto_increment,
trapoid varchar(100) default NULL,
enterprise varchar(100) default NULL,
community varchar(20) default NULL,
hostname varchar(100) default NULL,
agentip varchar(16) default NULL,
uptime varchar(20) default NULL,
traptime varchar(30) default NULL,
formatline varchar(255) default NULL,
trapread int(11) default '0',
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE snmptt.snmptt (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
eventname VARCHAR(50),
eventid VARCHAR(50),
trapoid VARCHAR(100),
enterprise VARCHAR(100),
community VARCHAR(20),
hostname VARCHAR(100),
agentip VARCHAR(16),
category VARCHAR(20),
severity VARCHAR(20),
uptime VARCHAR(20),
traptime VARCHAR(30),
formatline VARCHAR(255));

CREATE TABLE snmptt.snmptt_statistics (
stat_time VARCHAR(30),
total_received BIGINT,
total_translated BIGINT,
total_ignored BIGINT,
total_unknown BIGINT);

GRANT ALL ON snmptt.* to 'snmptt'@'localhost' identified by 'snmptt';

i have set the login ceredentials in snmptt.ini

now the following error comes.
MySQL error: Unable to connect to database: Access denied for user 'snmptt '@'localhost' (using password: YES)

i see the traps in the unknownlogfile
i dont see the trap in nagiosxi configured with the snmp trap wizard
how to install CISCO-STACK-MIB.my

Re: Problems with Hosts

Posted: Mon Sep 17, 2012 10:17 am
by scottwilkerson
If you are seeing them in the unknown log the mib wasn't added

See page 2 of this document "Installing MIBs"
http://assets.nagios.com/downloads/nagi ... ith_XI.pdf

As for logging to mysql, I'm not totally familiar with this but did you set the credentials something like this:

Code: Select all

[SQL]
db_translate_enterprise = 0
db_unknown_trap_format = '$-*'
mysql_dbi_host = localhost
mysql_dbi_port = 3306
mysql_dbi_database = snmptt
mysql_dbi_table = snmptt
mysql_dbi_table_unknown = snmptt_unknown
mysql_dbi_username = snmptt
mysql_dbi_password = snmptt

Re: Problems with Hosts

Posted: Mon Sep 17, 2012 3:27 pm
by shakra2005
its that the onlay thing to do ?

i have added the mibs with snmpttconvertmib

Re: Problems with Hosts

Posted: Tue Sep 18, 2012 7:57 am
by scottwilkerson
did you run the addmib command as per the documentation?
you will also need to restart the service