Hi all .
I have some SQL scripts for monitoring Nortel Baystacks 470 switchs . This should work with most Nortel Products and the most of the network switchs . Because I use the ISO SNMP OIDs and MIB to do that . For CISCO problably you will need to change the port number ( the value from the OID ) . This information is in Mpbs for easy view.
I would like to share that but this forum only allow 10000 caracters per message .
Anyone knows where I can share that ?
Here a Example .
1. creating the template .
----------- SQL Script ---------------
use zabbix;
insert into `hosts` (`hostid`,`host`,`useip`,`ip`,`port`,`status`,`dis able_until`,`error`,`available`,`errors_from`,`tem plateid`) values (11001, 'BS470_t', 0, '', 10050, 3, 0, '', 0, 0, 0);
--------------------------------------------
After that gos to zabbix and classified this host as template .
As I had in my enviroment RACKS with 4 Baystacks with 48 ports Cascaded I create the maximum number of ports .
2. Creating the Ifin octects for template
--------------- SQL Scritpt -------------------
use zabbix;
insert into `items` (`itemid`,`type`,`snmp_community`,`snmp_oid`,`snmp _port`,`hostid`,`description`,`key_`,`delay`,`hist ory`,`trends`,`nextcheck`,`lastvalue`,`lastclock`, `prevvalue`,`status`,`value_type`,`trapper_hosts`, `units`,`multiplier`,`delta`,`prevorgvalue`,`snmpv 3_securityname`,`snmpv3_securitylevel`,`snmpv3_aut hpassphrase`,`snmpv3_privpassphrase`,`formula`,`er ror`,`lastlogsize`,`logtimefmt`,`templateid`,`valu emapid`) values (17401,4,'public','1.3.6.1.2.1.2.2.1.10.1',161,110 01,'Port Trafic - In - Port 1 Unit 1','ifInOctects.Port1.Unit1',60,270,365,0,NULL,NUL L,NULL,0,3,'','bits',1,2,NULL,'',0,'','','8','',0, '',0,0);
insert into `items` (`itemid`,`type`,`snmp_community`,`snmp_oid`,`snmp _port`,`hostid`,`description`,`key_`,`delay`,`hist ory`,`trends`,`nextcheck`,`lastvalue`,`lastclock`, `prevvalue`,`status`,`value_type`,`trapper_hosts`, `units`,`multiplier`,`delta`,`prevorgvalue`,`snmpv 3_securityname`,`snmpv3_securitylevel`,`snmpv3_aut hpassphrase`,`snmpv3_privpassphrase`,`formula`,`er ror`,`lastlogsize`,`logtimefmt`,`templateid`,`valu emapid`) values (17402,4,'public','1.3.6.1.2.1.2.2.1.10.2',161,110 01,'Port Trafic - In - Port 2 Unit 1','ifInOctects.Port2.Unit1',60,270,365,0,NULL,NUL L,NULL,0,3,'','bits',1,2,NULL,'',0,'','','8','',0, '',0,0);
insert into `items` (`itemid`,`type`,`snmp_community`,`snmp_oid`,`snmp _port`,`hostid`,`description`,`key_`,`delay`,`hist ory`,`trends`,`nextcheck`,`lastvalue`,`lastclock`, `prevvalue`,`status`,`value_type`,`trapper_hosts`, `units`,`multiplier`,`delta`,`prevorgvalue`,`snmpv 3_securityname`,`snmpv3_securitylevel`,`snmpv3_aut hpassphrase`,`snmpv3_privpassphrase`,`formula`,`er ror`,`lastlogsize`,`logtimefmt`,`templateid`,`valu emapid`) values (17403,4,'public','1.3.6.1.2.1.2.2.1.10.3',161,110 01,'Port Trafic - In - Port 3 Unit 1','ifInOctects.Port3.Unit1',60,270,365,0,NULL,NUL L,NULL,0,3,'','bits',1,2,NULL,'',0,'','','8','',0, '',0,0);
insert into `items` (`itemid`,`type`,`snmp_community`,`snmp_oid`,`snmp _port`,`hostid`,`description`,`key_`,`delay`,`hist ory`,`trends`,`nextcheck`,`lastvalue`,`lastclock`, `prevvalue`,`status`,`value_type`,`trapper_hosts`, `units`,`multiplier`,`delta`,`prevorgvalue`,`snmpv 3_securityname`,`snmpv3_securitylevel`,`snmpv3_aut hpassphrase`,`snmpv3_privpassphrase`,`formula`,`er ror`,`lastlogsize`,`logtimefmt`,`templateid`,`valu emapid`) values (17404,4,'public','1.3.6.1.2.1.2.2.1.10.4',161,110 01,'Port Trafic - In - Port 4 Unit 1','ifInOctects.Port4.Unit1',60,270,365,0,NULL,NUL L,NULL,0,3,'','bits',1,2,NULL,'',0,'','','8','',0, '',0,0);
insert into `items` (`itemid`,`type`,`snmp_community`,`snmp_oid`,`snmp _port`,`hostid`,`description`,`key_`,`delay`,`hist ory`,`trends`,`nextcheck`,`lastvalue`,`lastclock`, `prevvalue`,`status`,`value_type`,`trapper_hosts`, `units`,`multiplier`,`delta`,`prevorgvalue`,`snmpv 3_securityname`,`snmpv3_securitylevel`,`snmpv3_aut hpassphrase`,`snmpv3_privpassphrase`,`formula`,`er ror`,`lastlogsize`,`logtimefmt`,`templateid`,`valu emapid`) values (17405,4,'public','1.3.6.1.2.1.2.2.1.10.5',161,110 01,'Port Trafic - In - Port 5 Unit 1','ifInOctects.Port5.Unit1',60,270,365,0,NULL,NUL L,NULL,0,3,'','bits',1,2,NULL,'',0,'','','8','',0, '',0,0);
insert into `items` (`itemid`,`type`,`snmp_community`,`snmp_oid`,`snmp _port`,`hostid`,`description`,`key_`,`delay`,`hist ory`,`trends`,`nextcheck`,`lastvalue`,`lastclock`, `prevvalue`,`status`,`value_type`,`trapper_hosts`, `units`,`multiplier`,`delta`,`prevorgvalue`,`snmpv 3_securityname`,`snmpv3_securitylevel`,`snmpv3_aut hpassphrase`,`snmpv3_privpassphrase`,`formula`,`er ror`,`lastlogsize`,`logtimefmt`,`templateid`,`valu emapid`) values (17406,4,'public','1.3.6.1.2.1.2.2.1.10.6',161,110 01,'Port Trafic - In - Port 6 Unit 1','ifInOctects.Port6.Unit1',60,270,365,0,NULL,NUL L,NULL,0,3,'','bits',1,2,NULL,'',0,'','','8','',0, '',0,0);
insert into `items` (`itemid`,`type`,`snmp_community`,`snmp_oid`,`snmp _port`,`hostid`,`description`,`key_`,`delay`,`hist ory`,`trends`,`nextcheck`,`lastvalue`,`lastclock`, `prevvalue`,`status`,`value_type`,`trapper_hosts`, `units`,`multiplier`,`delta`,`prevorgvalue`,`snmpv 3_securityname`,`snmpv3_securitylevel`,`snmpv3_aut hpassphrase`,`snmpv3_privpassphrase`,`formula`,`er ror`,`lastlogsize`,`logtimefmt`,`templateid`,`valu emapid`) values (17407,4,'public','1.3.6.1.2.1.2.2.1.10.7',161,110 01,'Port Trafic - In - Port 7 Unit 1','ifInOctects.Port7.Unit1',60,270,365,0,NULL,NUL L,NULL,0,3,'','bits',1,2,NULL,'',0,'','','8','',0, '',0,0);
after All a scripts for functions and triggers for alert with some one have a traficc up than 100000k in one minute .
I know that I could do a bash srcipt but I was using a Mysql GUI to update the databse so once done the full script, I left in that way .
Best Regards ,
Saulo Augusto Silva
I have some SQL scripts for monitoring Nortel Baystacks 470 switchs . This should work with most Nortel Products and the most of the network switchs . Because I use the ISO SNMP OIDs and MIB to do that . For CISCO problably you will need to change the port number ( the value from the OID ) . This information is in Mpbs for easy view.
I would like to share that but this forum only allow 10000 caracters per message .
Anyone knows where I can share that ?
Here a Example .
1. creating the template .
----------- SQL Script ---------------
use zabbix;
insert into `hosts` (`hostid`,`host`,`useip`,`ip`,`port`,`status`,`dis able_until`,`error`,`available`,`errors_from`,`tem plateid`) values (11001, 'BS470_t', 0, '', 10050, 3, 0, '', 0, 0, 0);
--------------------------------------------
After that gos to zabbix and classified this host as template .
As I had in my enviroment RACKS with 4 Baystacks with 48 ports Cascaded I create the maximum number of ports .
2. Creating the Ifin octects for template
--------------- SQL Scritpt -------------------
use zabbix;
insert into `items` (`itemid`,`type`,`snmp_community`,`snmp_oid`,`snmp _port`,`hostid`,`description`,`key_`,`delay`,`hist ory`,`trends`,`nextcheck`,`lastvalue`,`lastclock`, `prevvalue`,`status`,`value_type`,`trapper_hosts`, `units`,`multiplier`,`delta`,`prevorgvalue`,`snmpv 3_securityname`,`snmpv3_securitylevel`,`snmpv3_aut hpassphrase`,`snmpv3_privpassphrase`,`formula`,`er ror`,`lastlogsize`,`logtimefmt`,`templateid`,`valu emapid`) values (17401,4,'public','1.3.6.1.2.1.2.2.1.10.1',161,110 01,'Port Trafic - In - Port 1 Unit 1','ifInOctects.Port1.Unit1',60,270,365,0,NULL,NUL L,NULL,0,3,'','bits',1,2,NULL,'',0,'','','8','',0, '',0,0);
insert into `items` (`itemid`,`type`,`snmp_community`,`snmp_oid`,`snmp _port`,`hostid`,`description`,`key_`,`delay`,`hist ory`,`trends`,`nextcheck`,`lastvalue`,`lastclock`, `prevvalue`,`status`,`value_type`,`trapper_hosts`, `units`,`multiplier`,`delta`,`prevorgvalue`,`snmpv 3_securityname`,`snmpv3_securitylevel`,`snmpv3_aut hpassphrase`,`snmpv3_privpassphrase`,`formula`,`er ror`,`lastlogsize`,`logtimefmt`,`templateid`,`valu emapid`) values (17402,4,'public','1.3.6.1.2.1.2.2.1.10.2',161,110 01,'Port Trafic - In - Port 2 Unit 1','ifInOctects.Port2.Unit1',60,270,365,0,NULL,NUL L,NULL,0,3,'','bits',1,2,NULL,'',0,'','','8','',0, '',0,0);
insert into `items` (`itemid`,`type`,`snmp_community`,`snmp_oid`,`snmp _port`,`hostid`,`description`,`key_`,`delay`,`hist ory`,`trends`,`nextcheck`,`lastvalue`,`lastclock`, `prevvalue`,`status`,`value_type`,`trapper_hosts`, `units`,`multiplier`,`delta`,`prevorgvalue`,`snmpv 3_securityname`,`snmpv3_securitylevel`,`snmpv3_aut hpassphrase`,`snmpv3_privpassphrase`,`formula`,`er ror`,`lastlogsize`,`logtimefmt`,`templateid`,`valu emapid`) values (17403,4,'public','1.3.6.1.2.1.2.2.1.10.3',161,110 01,'Port Trafic - In - Port 3 Unit 1','ifInOctects.Port3.Unit1',60,270,365,0,NULL,NUL L,NULL,0,3,'','bits',1,2,NULL,'',0,'','','8','',0, '',0,0);
insert into `items` (`itemid`,`type`,`snmp_community`,`snmp_oid`,`snmp _port`,`hostid`,`description`,`key_`,`delay`,`hist ory`,`trends`,`nextcheck`,`lastvalue`,`lastclock`, `prevvalue`,`status`,`value_type`,`trapper_hosts`, `units`,`multiplier`,`delta`,`prevorgvalue`,`snmpv 3_securityname`,`snmpv3_securitylevel`,`snmpv3_aut hpassphrase`,`snmpv3_privpassphrase`,`formula`,`er ror`,`lastlogsize`,`logtimefmt`,`templateid`,`valu emapid`) values (17404,4,'public','1.3.6.1.2.1.2.2.1.10.4',161,110 01,'Port Trafic - In - Port 4 Unit 1','ifInOctects.Port4.Unit1',60,270,365,0,NULL,NUL L,NULL,0,3,'','bits',1,2,NULL,'',0,'','','8','',0, '',0,0);
insert into `items` (`itemid`,`type`,`snmp_community`,`snmp_oid`,`snmp _port`,`hostid`,`description`,`key_`,`delay`,`hist ory`,`trends`,`nextcheck`,`lastvalue`,`lastclock`, `prevvalue`,`status`,`value_type`,`trapper_hosts`, `units`,`multiplier`,`delta`,`prevorgvalue`,`snmpv 3_securityname`,`snmpv3_securitylevel`,`snmpv3_aut hpassphrase`,`snmpv3_privpassphrase`,`formula`,`er ror`,`lastlogsize`,`logtimefmt`,`templateid`,`valu emapid`) values (17405,4,'public','1.3.6.1.2.1.2.2.1.10.5',161,110 01,'Port Trafic - In - Port 5 Unit 1','ifInOctects.Port5.Unit1',60,270,365,0,NULL,NUL L,NULL,0,3,'','bits',1,2,NULL,'',0,'','','8','',0, '',0,0);
insert into `items` (`itemid`,`type`,`snmp_community`,`snmp_oid`,`snmp _port`,`hostid`,`description`,`key_`,`delay`,`hist ory`,`trends`,`nextcheck`,`lastvalue`,`lastclock`, `prevvalue`,`status`,`value_type`,`trapper_hosts`, `units`,`multiplier`,`delta`,`prevorgvalue`,`snmpv 3_securityname`,`snmpv3_securitylevel`,`snmpv3_aut hpassphrase`,`snmpv3_privpassphrase`,`formula`,`er ror`,`lastlogsize`,`logtimefmt`,`templateid`,`valu emapid`) values (17406,4,'public','1.3.6.1.2.1.2.2.1.10.6',161,110 01,'Port Trafic - In - Port 6 Unit 1','ifInOctects.Port6.Unit1',60,270,365,0,NULL,NUL L,NULL,0,3,'','bits',1,2,NULL,'',0,'','','8','',0, '',0,0);
insert into `items` (`itemid`,`type`,`snmp_community`,`snmp_oid`,`snmp _port`,`hostid`,`description`,`key_`,`delay`,`hist ory`,`trends`,`nextcheck`,`lastvalue`,`lastclock`, `prevvalue`,`status`,`value_type`,`trapper_hosts`, `units`,`multiplier`,`delta`,`prevorgvalue`,`snmpv 3_securityname`,`snmpv3_securitylevel`,`snmpv3_aut hpassphrase`,`snmpv3_privpassphrase`,`formula`,`er ror`,`lastlogsize`,`logtimefmt`,`templateid`,`valu emapid`) values (17407,4,'public','1.3.6.1.2.1.2.2.1.10.7',161,110 01,'Port Trafic - In - Port 7 Unit 1','ifInOctects.Port7.Unit1',60,270,365,0,NULL,NUL L,NULL,0,3,'','bits',1,2,NULL,'',0,'','','8','',0, '',0,0);
after All a scripts for functions and triggers for alert with some one have a traficc up than 100000k in one minute .
I know that I could do a bash srcipt but I was using a Mysql GUI to update the databse so once done the full script, I left in that way .
Best Regards ,
Saulo Augusto Silva
Comment