[racktables-users] Re: [racktables-users] Extract Hostname and IP

  • From: <rutger.hermarij@xxxxxxxxx>
  • To: "racktables-users@xxxxxxxxxxxxx" <racktables-users@xxxxxxxxxxxxx>
  • Date: Fri, 27 Mar 2015 05:52:24 +0000

I thinks its easier to install the “Sebastian Mogilowskis Blog” tools. (plugin)


Here you can export any object from racktables


http://www.mogilowski.net/lang/en-us/projects/racktables/




Rutger



Sent from Surface





From: itsme2501@xxxxxxxxxxx
Sent: ‎Thursday‎, ‎March‎ ‎26‎, ‎2015 ‎5‎:‎35‎ ‎PM
To: racktables-users@xxxxxxxxxxxxx






Hi all !





I am trying to extract the hostname and the ip of each objects of my 
RackTables, i found this usefull script on the wiki : 





<?php
$script_mode = TRUE;
require 'wwwroot/inc/init.php';
foreach (scanRealmByText ('object', '{server}') as $object)
{
        amplifyCell ($object);
        foreach ($object['ipv4'] + $object['ipv6'] as $ip_bin => $alloc)
                echo implode ("\t", [ $object['name'], $alloc['osif'], 
ip_format ($ip_bin) ]) . "\n";
}

But it will extract only server objects, i am trying to edit it to extract 
everything without testing the name, i want servers, routers, switch, i dont't 
care about the name.





I know it is a really basic questions but i am not able to edit it properlly to 
match everything.





Thank you

Other related posts:

  • » [racktables-users] Re: [racktables-users] Extract Hostname and IP - rutger.hermarij