Files
librenms-librenms/delhost.php
T

33 lines
698 B
PHP
Raw 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.
*
* @package LibreNMS
* @subpackage cli
* @copyright (C) 2006 - 2012 Adam Armstrong
*/
chdir(__DIR__); // cwd to the directory containing this script
2015-07-13 20:10:26 +02:00
require 'includes/defaults.inc.php';
require 'config.php';
require 'includes/definitions.inc.php';
require 'includes/functions.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
}