2010-09-03 18:26:59 +00:00
|
|
|
#!/usr/bin/env php
|
2009-09-07 11:07:59 +00:00
|
|
|
<?php
|
|
|
|
|
2012-05-09 10:01:42 +00:00
|
|
|
/**
|
2016-09-08 14:12:23 +01:00
|
|
|
* LibreNMS
|
2012-05-09 10:01:42 +00:00
|
|
|
*
|
2016-09-08 14:12:23 +01:00
|
|
|
* This file is part of LibreNMS.
|
2012-05-09 10:01:42 +00:00
|
|
|
*
|
2016-09-08 14:12:23 +01:00
|
|
|
* @package LibreNMS
|
2012-05-09 10:01:42 +00:00
|
|
|
* @subpackage cli
|
2013-10-28 12:01:36 -07:00
|
|
|
* @copyright (C) 2006 - 2012 Adam Armstrong
|
2012-05-09 10:01:42 +00:00
|
|
|
*/
|
|
|
|
|
2016-11-21 14:12:59 -06:00
|
|
|
$init_modules = array();
|
|
|
|
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]);
|
|
|
|
$id = getidbyname($host);
|
|
|
|
if ($id) {
|
|
|
|
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
|
|
|
}
|