BMC Atrium Discovery Community Forum

forgot password?
   
 
Supress ‘None’ in lists (like ip_addr)
Posted: 08 August 2012 08:34 PM   [ Ignore ]  
RankRankRankRank
Guru
Total Posts:  543
Joined:  2011-03-16

Is there a way when running a query that you can suppress the word ‘None’ if ther eare multiple entries in a list?

Basically, if a Host has multiple NetworkInterfaces, but only one shows up with an ip_addr, can we have it show only that one (without having to EXPLODE, just in case there are others with mutliple NICs). I have to write a report against all server hosts to show all the NICs, their IP, speed, gateway, subnet, etc… and some have multiple NICs but do not have data for each. Some are setup in a cluster (so it does have multiple IPs, etc…) so I neeed to show that.

Profile
 
 
Posted: 09 August 2012 05:48 AM   [ Ignore ]   [ # 1 ]  
BMC ADDM Staff
RankRankRankRank
Administrator
Total Posts:  1652
Joined:  2008-02-12

You mean something like:

SEARCH Host
SHOW name
,
replace(
  
replace(
    
replace(
      
join(fmt_map('%s'#DeviceWithInterface:DeviceInterface:InterfaceOfDevice:NetworkInterface.ip_addr), ', '),
    
', None'''),
  
'None, '''),
'None'''

The model change in Xenolith pre-release means this is much simpler as the IP address (stored in IPAddress) and network interface (stored in NetworkInterface) have been separated.

SEARCH Host
SHOW name
#DeviceWithAddress:DeviceAddress::IPAddress.ip_addr 

The role is missing between DeviceAddress and IPAddress as it can be either IPv4Address or IPv6Address depending upon the IP address type and we want both.

Obviously, just because something is in a pre-release does not mean it will appear in a released product.

Profile
 
 
Posted: 09 August 2012 12:16 PM   [ Ignore ]   [ # 2 ]  
RankRankRankRank
Guru
Total Posts:  543
Joined:  2011-03-16

I like the simple version better.

I’ll try the query you put above and see what it does. It gets me a little confused, but I think the basic concept is if it sees ‘, None’ or ‘None, ‘ or ‘None’ then replace it with ‘’. If this is the case, I think it should work.

Thank you for the assistance.

Profile