How to extract Log monitoring details from CA Spectrum systemEDGE models
search cancel

How to extract Log monitoring details from CA Spectrum systemEDGE models

book

Article ID: 241339

calendar_today

Updated On:

Products

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://<hostname>:8080/spectrum/restful/devices/?attr=0x1006e&attr=0x1160fbd&attr=0x11611a1&attr=0x1160fbe'

or the same from a Internet browser http://<hostname>: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== 

 

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==

 

 

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 = Name
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