SRX

Expand all | Collapse all

Event-options question ?

Jump to Best Answer
  • 1.  Event-options question ?

    Posted 11-29-2019 02:23

    Hi, Guys,

     

    I create a event-option to record the RPM results every 5 minutes, how could I append all results int the same files ( as the traceoption file, file size, and zipping files ) ?

     

    set event-options generate-event ping time-interval 300
    set event-options policy Policy1 events ping
    set event-options policy Policy1 then execute-commands commands "show service rpm history-results"
    set event-options policy Policy1 then execute-commands output-filename RPM_status.txt
    set event-options policy Policy1 then execute-commands output-format text
    set event-options policy Policy1 then execute-commands destination local-directory
    set event-options destinations local-directory archive-sites /var/log/

     

     

    Thanks a lot

     

     

     

     

     

     

     



  • 2.  RE: Event-options question ?

     
    Posted 11-29-2019 03:04

    Hello Ben,

     

    You can achieve this by using the append option in cli.

     

    set event-options policy Policy1 then execute-commands commands "show service rpm history-results | append /var/log/RPM_status.txt"

     

    With this you would not need to specify the output-file format,destination etc.

     

    I hope this helps. Regards,

     

    Vikas



  • 3.  RE: Event-options question ?

    Posted 12-01-2019 18:34

    Hi, Nelumbo,

     

    This is a good tool, thanks so much for your advice.

     

    But "commit" does not work If I remove the following commands :

    1. set event-options policy Policy1 then execute-commands output-filename RPM_status
    2. set event-options policy Policy1 then execute-commands destination local-directory
    3. set event-options policy Policy1 then execute-commands output-format text
    4. set event-options destinations local-directory archive-sites /var/log/

     

     

    Also, due to the file "RPM_status" is increasing unlimitely, can I :

    1. zip the file evey day

    2. set 10 pcs of zipped file at max

    3. wipe out the oldest files

    4. so they are in turn

     

    I want to keep the rpm test and records up to around 10 days 

     

    How to achieve this requirement ?

     

    Many thanks



  • 4.  RE: Event-options question ?
    Best Answer

     
    Posted 12-01-2019 19:29

    Hello Ben,

     

    I was able to commit with this configuration. Here is a sample from my lab running 15.1.

     

    I believe you would need to use the event ping_test_completed rather than ping, secondly the archive options for a specific file can be set under system syslog.

     

    set event-options policy Policy1 events ping_test_completed 
    set event-options policy Policy1 then execute-commands commands "show service rpm history-results | append /var/log/RPM_status.txt"
    
    set system syslog file history-results archive files 10 size 5M

     

    I hope this helps. Regards,

     

    Nelumbo



  • 5.  RE: Event-options question ?

    Posted 12-02-2019 01:14

    Hi, Nelumbo,

     

    You are right, after a few tests;  thanks a lot.

     

    Cheers






  • 6.  RE: Event-options question ?

     
    Posted 12-08-2019 19:19

    Hello Ben,

     

    Thanks, I am glad that helped.

     

    Regards,

     

    Nelumbo



  • 7.  RE: Event-options question ?

     
    Posted 11-29-2019 13:40

    Hi Ben,

     

     The following KB was recently created to accomplish that task:

    https://kb.juniper.net/InfoCenter/index?page=content&id=KB35268

     

    Please mark as resolved if it helped you with your concern.

    Thanks!