Added default NCM templates

This commit is contained in:
Enrique Martin 2023-11-06 15:06:16 +01:00
parent 366018b0e9
commit 3506ba1b5a
2 changed files with 1148 additions and 5 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2512,11 +2512,32 @@ INSERT INTO `tncm_vendor` (`id`, `name`) VALUES
(11, 'Netlink'), (11, 'Netlink'),
(12, 'Ascom'), (12, 'Ascom'),
(13, 'Synology Inc.'), (13, 'Synology Inc.'),
(14, 'Fujitsu Network Communications, Inc.'); (14, 'Fujitsu Network Communications, Inc.'),
(15, 'Juniper'),
(16, 'Palo Alto'),
(17, 'A10'),
(18, 'Aruba'),
(19, 'Mikrotik');
INSERT INTO `tncm_model` VALUES (1,1,'7200'); INSERT INTO `tncm_model` VALUES
(1,1,'7200'),
(2,1,'Cisco-Generic'),
(3,15,'Juniper-Generic'),
(4,16,'Palo Alto-Generic'),
(5,17,'A10-Generic'),
(6,4,'Alcatel-Generic'),
(7,18,'Aruba-Generic'),
(8,19,'Mikrotik-Generic');
INSERT INTO `tncm_template` VALUES (1,'cisco-base','[\"1\"]','[\"1\"]'); INSERT INTO `tncm_template` VALUES
(1,'cisco-base','[\"1\"]','[\"1\"]'),
(2,'Cisco-Generic','[\"1\"]','[\"2\"]'),
(3,'Juniper-Generic','[\"15\"]','[\"3\"]'),
(4,'Palo Alto-Generic','[\"16\"]','[\"4\"]'),
(5,'A10-Generic','[\"17\"]','[\"5\"]'),
(6,'Alcatel-Generic','[\"4\"]','[\"6\"]'),
(7,'Aruba-Generic','[\"18\"]','[\"7\"]'),
(8,'Mikrotik-Generic','[\"19\"]','[\"8\"]');
INSERT INTO `tncm_script` VALUES INSERT INTO `tncm_script` VALUES
(1,0,'enable
expect:Password:\s*
_enablepass_
exit'), (1,0,'enable
expect:Password:\s*
_enablepass_
exit'),
@ -2524,9 +2545,124 @@ INSERT INTO `tncm_script` VALUES
(3,2,'enable
expect:Password:\s*
_enablepass_
term length 0
config terminal
_applyconfigbackup_
exit
'), (3,2,'enable
expect:Password:\s*
_enablepass_
term length 0
config terminal
_applyconfigbackup_
exit
'),
(4,3,'enable
expect:Password:\s*
_enablepass_
term length 0
capture:show version | i IOS Software
exit
'), (4,3,'enable
expect:Password:\s*
_enablepass_
term length 0
capture:show version | i IOS Software
exit
'),
(5,5,'enable
expect:Password:\s*
_enablepass_
term length 0
config term
end
end
exit
'), (5,5,'enable
expect:Password:\s*
_enablepass_
term length 0
config term
end
end
exit
'),
(6,4,'copy tftp flash
expect:\]\?
_TFTP_SERVER_IP_
expect:\]\?
_SOURCE_FILE_NAME_
expect:\]\?
_DESTINATION_FILE_NAME_
show flash
reload
expect:confirm
y
config terminal
boot system _DESTINATION_FILE_NAME_'); (6,4,'copy tftp flash
expect:\]\?
_TFTP_SERVER_IP_
expect:\]\?
_SOURCE_FILE_NAME_
expect:\]\?
_DESTINATION_FILE_NAME_
show flash
reload
expect:confirm
y
config terminal
boot system _DESTINATION_FILE_NAME_'),
(7,0,'enable\n
expect:Password:\s*
_enablepass_\n
exit\n'),
(8,1,'enable\n
expect:Password:\s*
_enablepass_\n
term length 0\n
capture:show running-config\n
exit\n'),
(9,2,'enable\n
expect:Password:\s*
_enablepass_\n
term length 0\n
config terminal\n
_applyconfigbackup_\n
exit\n'),
(10,3,'enable\n
expect:Password:\s*
_enablepass_\n
term length 0\n
capture:show version | i IOS Software\n
exit\n'),
(11,4,'copy tftp flash\n
expect:\]\?
_TFTP_SERVER_IP_\n
expect:\]\?
_SOURCE_FILE_NAME_\n
expect:\]\?
_DESTINATION_FILE_NAME_\n
show flash\n
reload\n
expect:confirm
y\n
config terminal\n
boot system _DESTINATION_FILE_NAME_\n'),
(12,5,''),
(13,7,''),
(14,0,'expect:root@%
cli\n
exit\n'),
(15,1,'expect:root@%
cli\n
expect:root>
capture:show configuration\n
capture:\n
quit\n
expect:root@%
exit\n'),
(16,2,'expect:root@%
cli\n
expect:root>
configure\n
load override terminal\n
_applyconfigbackup_\n
commit\n
exit\n'),
(17,3,'expect:root@%
cli\n
expect:root>
capture:show version|match Junos:\n
capture: \n
quit\n
expect:root@%
exit\n'),
(18,4,'expect:root@%
cli\n
expect:root>
save software from tftp _TFTP_SERVER_IP_ _FIRMWARE_NAME_ to flash\n
reset\n
exit\n'),
(19,5,''),
(20,7,''),
(21,0,'sleep:1
exit\n'),
(22,1,'set cli pager off \n
capture:show config running\n
exit\n'),
(23,2,'set cli terminal width 500\n
set cli scripting-mode on\n
configure\n
_applyconfigbackup_\n
commit\n'),
(24,3,'set cli pager off \n
capture:show system info | match app-version:\n
sleep:1 
expect:app-version:\s*
exit \n'),
(25,4,'tftp import software from _TFTP_SERVER_IP_ file _FIRMWARE_NAME_\n
request system software install version\n
reboot\n
exit\n'),
(26,5,''),
(27,7,''),
(28,0,'sleep:1
enable\n
expect:Password:\s*
_enablepass_\n'),
(29,1,'sleep:1
enable\n
expect:Password:\s*
_enablepass_\n
capture:show running-config\n
exit\n'),
(30,2,'sleep:1
enable\n
expect:Password:\s*
_enablepass_\n
configure\n
_applyconfigbackup_\n
exit\n'),
(31,3,'sleep:1
enable\n
expect:Password:\s*
_enablepass_\n
capture:show version\n
exit\n'),
(32,4,'sleep:1
enable\n
expect:Password:\s*
_enablepass_\n
configure\n
expect:(config)
restore _TFTP_SERVER_IP_/_FIRMWARE_NAME_\n
expect:Password:\s*
_enablepass_\n
expect:skip port map
yes\n
expect: see the diff
yes\n
sleep:1
expect:Proceed with reboot
yes\n
expect:eof'),
(33,5,''),
(34,7,''),
(35,0,'enable\n
expect:Password:\s*
_enablepass_\n
exit\n'),
(36,1,'enable\n
expect:Password:\s*
_enablepass_\n
capture:admin display-config\n
logout\n'),
(37,2,''),
(38,3,'enable\n
expect:Password:\s*
_enablepass_\n
capture:show version\n
logout\n'),
(39,4,''),
(40,5,''),
(41,7,''),
(42,0,'enable\n
expect:Password:\s*
_enablepass_\n
exit\n'),
(43,1,'enable\n
expect:Password:\s*
_enablepass_\n
capture:show running-config\n
exit\n'),
(44,2,'configure terminal\n
load replace /var/tmp/file.conf\n
end\n
write memory\n
exit\n'),
(45,3,'enable\n
expect:Password:\s*
_enablepass_\n
capture:show version\n
exit\n'),
(46,4,'copy tftp flash _TFTP_SERVER_IP_ _DESTINATION_FILE_NAME_.swi secondary\n
boot system flash secondary\n
copy tftp flash  _TFTP_SERVER_IP_ _DESTINATION_FILE_NAME_ primary\n
boot system flash primary\n'),
(47,5,''),
(48,7,''),
(49,0,'sleep:1
exit\n\r'),
(50,1,'sleep:1
capture:system resource print\n\r 
exit\n\r'),
(51,2,'sleep:1
system backup load name=_nameBackup_ password=_passwordBackup_\n\r
expect:Restore
yes\n\r
exit\n\r'),
(52,3,'sleep:1
capture:/system package print\n\r 
exit\n\r'),
(53,4,'sleep:1
/system routerboard upgrade\n\r
expect:Do
yes\n\r
exit\n\r'),
(54,5,''),
(55,7,'');
INSERT INTO `tncm_template_scripts`(`id_template`, `id_script`) VALUES (1,1),(1,2),(1,3),(1,4),(1,5),(1,6); INSERT INTO `tncm_template_scripts`(`id_template`, `id_script`) VALUES
(1,1),
(1,2),
(1,3),
(1,4),
(1,5),
(1,6),
(2,7),
(2,8),
(2,9),
(2,10),
(2,11),
(2,12),
(3,14),
(3,15),
(3,16),
(3,17),
(3,18),
(3,19),
(4,21),
(4,22),
(4,23),
(4,24),
(4,25),
(4,26),
(5,28),
(5,29),
(5,30),
(5,31),
(5,32),
(5,33),
(6,35),
(6,36),
(6,37),
(6,38),
(6,39),
(6,40),
(7,42),
(7,43),
(7,44),
(7,45),
(7,46),
(7,47),
(8,49),
(8,50),
(8,51),
(8,52),
(8,53),
(8,54);
INSERT INTO `tncm_agent_data_template` VALUES
(1,'Cisco-Generic','[\"1\"]','[\"2\"]'),
(2,'Juniper-Generic','[\"15\"]','[\"3\"]'),
(3,'Palo Alto-Generic','[\"16\"]','[\"4\"]'),
(4,'A10-Generic','[\"17\"]','[\"5\"]'),
(5,'Alcatel-Generic','[\"4\"]','[\"6\"]'),
(6,'Aruba-Generic','[\"18\"]','[\"7\"]'),
(7,'Mikrotik-Generic','[\"19\"]','[\"8\"]');
INSERT INTO `tncm_agent_data_template_scripts`(`id_agent_data_template`, `id_script`) VALUES
(1,13),
(2,20),
(3,27),
(4,34),
(5,41),
(6,48),
(7,55),
INSERT INTO `talert_calendar` VALUES (1, 'Default', 0, 'Default calendar'); INSERT INTO `talert_calendar` VALUES (1, 'Default', 0, 'Default calendar');