2017-02-02 16:44:15 +01:00
|
|
|
#!/usr/bin/env php
|
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
* LibreNMS
|
|
|
|
*
|
|
|
|
* Copyright (c) 2017 Xavier Beaudouin <kiwi@oav.net>
|
|
|
|
* This program is free software: you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation, either version 3 of the License, or (at your
|
|
|
|
* option) any later version. Please see LICENSE.txt at the top level of
|
|
|
|
* the source code distribution for details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
$init_modules = [];
|
|
|
|
require realpath(__DIR__ . '/..') . '/includes/init.php';
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
# RANCID router.db autogenerated by LibreNMS
|
|
|
|
# Do not edit this file manualy
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Rancid real OS to rancid OS map.
|
|
|
|
* Maybe we can add this somewhere?
|
|
|
|
*/
|
2017-08-23 11:29:40 -07:00
|
|
|
$rancid_map['arista_eos'] = 'arista';
|
|
|
|
$rancid_map['asa'] = 'cisco';
|
|
|
|
$rancid_map['avocent'] = 'avocent';
|
|
|
|
$rancid_map['edgeos'] = 'edgerouter';
|
2020-05-25 17:41:52 +02:00
|
|
|
$rancid_map['edgeswitch'] = 'edgemax';
|
2017-08-23 11:29:40 -07:00
|
|
|
$rancid_map['f5'] = 'f5';
|
|
|
|
$rancid_map['fortigate'] = 'fortigate';
|
2021-05-22 00:08:35 +02:00
|
|
|
$rancid_map['fortiswitch'] = 'fortigate';
|
2017-08-23 11:29:40 -07:00
|
|
|
$rancid_map['ftos'] = 'force10';
|
|
|
|
$rancid_map['ios'] = 'cisco';
|
|
|
|
$rancid_map['iosxe'] = 'cisco';
|
|
|
|
$rancid_map['iosxr'] = 'cisco-xr';
|
|
|
|
$rancid_map['ironware'] = 'foundry';
|
|
|
|
$rancid_map['junos'] = 'juniper';
|
|
|
|
$rancid_map['pfsense'] = 'pfsense';
|
|
|
|
$rancid_map['procurve'] = 'hp';
|
|
|
|
$rancid_map['nxos'] = 'cisco-nx';
|
|
|
|
$rancid_map['mikrotik'] = 'mikrotik';
|
2019-07-09 13:11:10 -05:00
|
|
|
$rancid_map['routeros'] = 'mikrotik';
|
2017-08-23 11:29:40 -07:00
|
|
|
$rancid_map['screenos'] = 'netscreen';
|
2017-08-30 20:05:32 +01:00
|
|
|
$rancid_map['xos'] = 'extreme';
|
2019-03-12 19:20:02 +01:00
|
|
|
$rancid_map['ciscosb'] = 'cisco-sb';
|
2020-05-16 06:47:36 +02:00
|
|
|
$rancid_map['allied'] = 'at';
|
|
|
|
$rancid_map['radlan'] = 'at';
|
|
|
|
$rancid_map['ciscowlc'] = 'cisco-wlc8';
|
2020-09-23 13:35:14 +02:00
|
|
|
$rancid_map['comware'] = 'h3c';
|
2020-09-28 15:57:54 +00:00
|
|
|
$rancid_map['panos'] = 'paloalto';
|
2022-01-18 21:27:35 +01:00
|
|
|
$rancid_map['fs-switch'] = 'cisco';
|
2022-03-24 23:14:48 +01:00
|
|
|
$rancid_map['vyos'] = 'vyos';
|
2022-04-08 13:37:20 +02:00
|
|
|
$rancid_map['mrv-od'] = 'mrv';
|
2017-02-02 16:44:15 +01:00
|
|
|
|
|
|
|
foreach (dbFetchRows("SELECT `hostname`,`os`,`disabled`,`status` FROM `devices` WHERE `ignore` = 0 AND `type` != '' GROUP BY `hostname`") as $devices) {
|
|
|
|
if (isset($rancid_map[$devices['os']])) {
|
|
|
|
$status = 'up';
|
|
|
|
if ($devices['disabled']) {
|
|
|
|
$status = 'down';
|
|
|
|
}
|
2020-09-09 16:10:36 +02:00
|
|
|
echo $devices['hostname'] . ';' . $rancid_map[$devices['os']] . ';' . $status . PHP_EOL;
|
2017-02-02 16:44:15 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
echo '# EOF ' . PHP_EOL;
|