search cancel

How to extract Log monitoring details from CA Spectrum systemEDGE models

book

Article ID: 241339

calendar_today

Updated On:

Products

CA Spectrum

Issue/Introduction

Customer requirement is to have the list of all monitored log files of systemEDGE host models in a bulk.

Currently you can list and extract this information of a single device at time in OneClick 

 

 

Environment

Release : 20.2.x,21.2.x

Component : Spectrum Applications

Resolution

Three possible approaches to obtain that information:

1) Using Restful API GET devices

see https://techdocs.broadcom.com/us/en/ca-enterprise-software/it-operations-management/spectrum/21-2/programming/web-services-api-reference/how-to-use-the-ca-spectrum-web-services-api/restful-resources-nouns/devices.html

for example using the curl from windows command prompt:

curl -X GET -H -u spectrum:spectrum -i 'http://muntestxxxxx.bpc.broadcom.net:8080/spectrum/restful/devices/?attr=0x1006e&attr=0x1160fbd&attr=0x11611a1&attr=0x1160fbe'

or the same from a Internet browser http://muntestxxxxx.bpc.broadcom.net:8080/spectrum/restful/devices/?attr=0x1006e&attr=0x1160fbd&attr=0x11611a1&attr=0x1160fbe pointing to your OC server..

The above restful api call for all devices will list the attributes 0x1006e, 0x1160fbd, 0x11611a1, 0x1160fbe  

example:

https://api-broadcom-ca.wolkenservicedesk.com/attachment/get_attachment_content?uniqueFileId=w0zNpuTeS41QyBCOz8cp9w== 

and the above restful will produce an output similar to:

https://api-broadcom-ca.wolkenservicedesk.com/attachment/get_attachment_content?uniqueFileId=yMfqibovITjyaMtdjQZkbw== 

Note in case those attributes do not exist for the device you will get "NoSuchAttribute"

2) Adding the required attributes as column to a Locater search results

Create a file called table-searchresults-config.xml that contains:

<?xml version="1.0" encoding="UTF-8"?>
<!--


   CA Technologies, Inc.
   One CA Plaza
   Islandia, NY 11749 USA

   Copyright (c) 2006 CA Technologies, Inc.
   All rights reserved.

   IN NO EVENT SHALL CA TECHNOLOGIES INCORPORATED BE LIABLE FOR
   ANY INCIDENTAL, INDIRECT, SPECIAL, OR CONSEQUENTIAL DAMAGES
   WHATSOEVER (INCLUDING BUT NOT LIMITED TO LOST PROFITS) ARISING OUT
   OF OR RELATED TO THIS SOFTWARE, EVEN IF CA TECHNOLOGIES INCORPORATED
   HAS BEEN ADVISED OF, KNOWN, OR SHOULD HAVE KNOWN, THE POSSIBILITY OF
   SUCH DAMAGES.


-->
<!--
-->

<table id="table-searchresults-config"
       idref="table-model-config">
     <column-list>
         <column>
               <name>Log Monitored</name>
               <content>
                 <attribute>0x1160fbd</attribute>
               </content>
         </column>
         <column>
               <name>Log Description</name>
               <content>
                 <attribute>0x11611a1</attribute>
               </content>
         </column>
         <column>
               <name>Log Regex</name>
               <content>
                 <attribute>0x1160fbe</attribute>
               </content>
         </column>
     </column-list>
</table>

Copy it in the  $SPECROOT/custom/topo/config on your OC server box.

Close and reopen the Console

On Locater create the following search:

https://api-broadcom-ca.wolkenservicedesk.com/attachment/get_attachment_content?uniqueFileId=tdXPQ2yBPqwBVsdm4R5lOA== 

Launch it

Right click on one of the displayed column name and select the columns you want to see eg.

https://api-broadcom-ca.wolkenservicedesk.com/attachment/get_attachment_content?uniqueFileId=N6ID0CtjMuRZ0wwRhyxZXA==

The result of search will be something like this:

https://api-broadcom-ca.wolkenservicedesk.com/attachment/get_attachment_content?uniqueFileId=TMkvMAjVU/lle6LmuVNVYQ== 

Export the result in a csv file you will obtain something like:

https://api-broadcom-ca.wolkenservicedesk.com/attachment/get_attachment_content?uniqueFileId=rWtt55RHqus9/ly6FvHtfg== 

3) Using a CLI script like the following:

-------------------------

#!/bin/bash
                       
# Connect to the VNM shell
./connect

CLIMNAMEWIDTH=64   
export CLIMNAMEWIDTH

echo "List of systemEDGE devices with their monitored log files" > report.list

./show devices | grep -i Host_systemEDGE > ./devices.list
file=devices.list
while IFS=' ' read -r MHandle modelname f3 f4
do
   echo " " >> report.list
   echo  "device name =" $modelname >> report.list                  
   ./show attributes attr=0x1160fbd attr=0x11611a1 attr=0x1160fbe mh=$MHandle >> report.list            
done < "$file"

# Disconnect from the VNM shell
./disconnect

----------------------

It will create a report.list file with the following sample of info:

List of systemEDGE devices with their monitored log files
 
device name = lvnkbdlxxxxx.bpc.broadcom.net
Id                Name                                             Iid                  Value
0x1160fbd   logMonitorLogFile                         1                    sysedge.log
0x1160fbd   logMonitorLogFile                         2                    syslog.log
0x11611a1   logMonitorDescr                           1                    test
0x11611a1   logMonitorDescr                           2                    
0x1160fbe   logMonitorRegularExpression       1                    hello
0x1160fbe   logMonitorRegularExpression       2                    test

Additional Information

to add log file size to the report, use attribute 0x1160fc3

https://api-broadcom-ca.wolkenservicedesk.com/attachment/get_attachment_content?uniqueFileId=HOFE5d08h6jzCa9/6+k6Hw==

For a REST call add to the command line &attr=0x1160fc3

e.g. http://localhost/spectrum/restful/devices/?attr=0x1006e&attr=0x1160fc3&attr=0x1160fbd&attr=0x11611a1&attr=0x1160fbe

I get size in red on the 1 sysedge device i have on my lab included in the full list

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<model-response-list total-models="14" throttle="14" error="EndOfResults">
<model-responses>
<model mh="0x2000573">
<attribute id="0x1006e"> 
thisLab
 </attribute>
<attribute-list id="0x1160fc3">
<instance oid="1" value="0" />
<instance oid="2" value="0" />
 </attribute-list>
<attribute-list id="0x1160fbd">
<instance oid="1" value="sysedge.log" />
<instance oid="2" value="syslog.log" />
 </attribute-list>
<attribute-list id="0x11611a1">
<instance oid="1" value="test" />
<instance oid="2" value="" />
 </attribute-list>
<attribute-list id="0x1160fbe">
<instance oid="1" value="hello" />
<instance oid="2" value="test" />
 </attribute-list>
 </model>

Attachments