DX NetOps

 View Only

 How to output a list of alarms to a file

MARUBUN SUPPORT's profile image
MARUBUN SUPPORT posted Apr 22, 2025 05:47 AM
Hi Team.
Our customer has the following questions.
I would appreciate some advice on how to solve this question.
[Product]
Spectrum 23.3
RHEL7.2
[Questions]
This question is related to the following question.
I would appreciate it if you could give me some advice.
 
  • Number of important alarms and number of important events do not match

          https://community.broadcom.com/discussion/number-of-important-alarms-and-number-of-important-events-do-not-match 

    • Records in the alarminfo table in the Reporting database

             https://community.broadcom.com/question/records-in-the-alarminfo-table-in-the-reporting-database

    • Conditions for saving alarms to the Reporting DB 
              https://community.broadcom.com/question/conditions-for-saving-alarms-to-the-reporting-db

    [Question]
    After presenting the answers to the previous inquiries to the end user, 
    the end user understood that there is a difference between the number of alarms displayed 
    on the OneClick screen and the number of records stored in the ReportingDB.

    End user requirements
    "I want to extract the information and number of alarms displayed on the OneClick screen from a Spectrum DB somewhere."
    It would be better if I could narrow down the results by the period when the alarms were generated or by their importance.

    Could you please confirm whether there is a way to achieve this requirement?

    Thanks,
    MARUBUN SUPPORT's profile image
    MARUBUN SUPPORT

    Hi everyone,

    Could someone please give me some advice on my question? 
    I would be very grateful for any advice.

    Thanks,

    Catalin Farcasanu's profile image
    Catalin Farcasanu

    As I explained before, in the mentioned threads, the information that is displayed in the OC server is not the same as the one you get from either ArchiveManger (DDMDB) or Reporting Manager (SRMdb). Each one from the 3 serves different purposes.

    In the OC, you see active alarms. Important attributes for an active alarms are: Alarm Creation Date, Alarm Last Modified Date, Alarm Status, Alarm TroubleTicket, Alarm Assignment, Alarm Acknowledgement, Alarm Occurrences.  Once an alarm is Cleared, it is not present in the OC anymore. OC is used by NOC for troubleshooting purposes.

    ArchiveManager (DDMB) stores information on events that are configured to be saved. Not all events are saved to the DDMDb. Events and alarms are displayed in the OC, in the Events tab. Some sort of reporting can be done here, directly on the Archive Manager MySQL database or via RestAPI calls, for Events. 

    Spectrum Report Manager (SRMDB) stores information on events that are configured to be saved in DDMDB and alarms and their associated actions (Alarm Created, Alarm Modified, Alarm Acknowledgment, Alarm Change, Alarm Clearance). Attention, It does not store information on the Alarm Occurrences (The information you see on the OC column under Occurrences). That value is stored only on the active alarm in the OC. Once the alarm is not active in the OC anymore, the information is gone. Reports here are the ones that are available on the CABI or via direct interrogation in the DB. 

    From a reporting perspective, an alarm is important as in indication of a faulty condition and it does not matter how many occurrences you have for it. What matters is having the condition resolved and the alarm cleared. So it matter how much time it took to be assigned or to be acknowledged. Maybe also time to clearance. 

    From a NOC perspective, it matters how many occurrences an alarm has, as it might indicate a more serious problem. A more serious problem that is not flooding the OC with many alarms, it is only one alarm, that has several occurrences since it has first appeared on the system. This is stored on the alarm as an attribute, until the alarm is cleared. 

    Whenever you have thousands of active alarms in the OC, you want to see less alarms. 

    MARUBUN SUPPORT's profile image
    MARUBUN SUPPORT

    When we ran this in a customer's environment, we got the following results:
    Any advice would be appreciated.


    *******

    ※ SpectroServer 
    # id
    spadmin
    # cd /usr/Spectrum/mysql
    # bin/mysql --defaults-file=./my-spectrum.cnf -uroot -pMySqlR00t ddmdb
    :
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

    mysql> show tables;
    +----------------------+
    | Tables_in_ddmdb      |
    +----------------------+
    | attribute            |
    | db_descriptor        |
    | event                |
    | landscape            |
    | model                |
    | model_attribute      |
    | model_name_extension |
    | model_type           |
    | oid_suffix           |
    | partitionlog         |
    | statistic            |
    | statistic_string     |
    | statistic_ul64       |
    | user_def             |
    +----------------------+

    mysql> show columns from event;
    +----------------+-------------------+------+-----+---------+-------+
    | Field          | Type              | Null | Key | Default | Extra |
    +----------------+-------------------+------+-----+---------+-------+
    | model_h        | int unsigned      | NO   | PRI | NULL    |       |
    | utime          | int               | NO   | PRI | NULL    |       |
    | counter        | int unsigned      | NO   | PRI | NULL    |       |
    | clk_seq        | smallint unsigned | NO   | PRI | NULL    |       |
    | version        | tinyint           | NO   | PRI | NULL    |       |
    | node_id        | char(6)           | NO   | PRI | NULL    |       |
    | user_key       | int unsigned      | NO   |     | NULL    |       |
    | type           | int unsigned      | NO   | MUL | NULL    |       |
    | severity       | int unsigned      | NO   |     | NULL    |       |
    | vardata_string | mediumtext        | YES  |     | NULL    |       |
    +----------------+-------------------+------+-----+---------+-------+
    10 rows in set (0.01 sec)


    In your response, are the events, alarms, and related actions stored in the DDMDB the contents of the event table above?

    The contents of the column node_id are as follows:


    mysql> select node_id,count(node_id) from event group by node_id;
    +------------+----------------+
    | node_id    | count(node_id) |
    +------------+----------------+
    |  €Ñç     |         214397 |
    |  €Ñç)     |            450 |
    +------------+----------------+
    2 rows in set (0.12 sec)


    The ID seems to be garbled, what should I think about this?
    *******

    MARUBUN SUPPORT's profile image
    MARUBUN SUPPORT

    Hi everyone,

    I would be grateful for any advice on any additional questions.

    Thanks,

    Catalin Farcasanu's profile image
    Catalin Farcasanu

    The product documentation mentions how data should be extracted from either DDMDB or SRMDB