Files

26 lines
517 B
PHP
Raw Permalink Normal View History

2010-09-03 18:26:59 +00:00
#!/usr/bin/env php
2009-09-07 11:07:59 +00:00
<?php
/**
* LibreNMS
*
* This file is part of LibreNMS.
*
* @copyright (C) 2006 - 2012 Adam Armstrong
*/
2020-09-21 14:54:51 +02:00
$init_modules = [];
require __DIR__ . '/includes/init.php';
2007-04-03 14:10:23 +00:00
2015-07-13 20:10:26 +02:00
// Remove a host and all related data from the system
if ($argv[1]) {
$host = strtolower($argv[1]);
2020-09-21 14:54:51 +02:00
$id = getidbyname($host);
2015-07-13 20:10:26 +02:00
if ($id) {
2020-09-21 14:54:51 +02:00
echo delete_device($id) . "\n";
2016-08-28 17:32:55 -05:00
} else {
2015-07-13 20:10:26 +02:00
echo "Host doesn't exist!\n";
}
2016-08-28 17:32:55 -05:00
} else {
2015-07-13 20:10:26 +02:00
echo "Host Removal Tool\nUsage: ./delhost.php <hostname>\n";
2007-04-03 14:10:23 +00:00
}