SRX Services Gateway
Highlighted
SRX Services Gateway

Event-options question ?

‎11-29-2019 02:23 AM

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

 

 

 

 

 

 

 

6 REPLIES 6
Highlighted
SRX Services Gateway

Re: Event-options question ?

‎11-29-2019 03:03 AM

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

Highlighted
SRX Services Gateway

Re: Event-options question ?

‎11-29-2019 01:40 PM

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!

Highlighted
SRX Services Gateway

Re: Event-options question ?

[ Edited ]
‎12-01-2019 06:34 PM

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

Highlighted
SRX Services Gateway
Solution
Accepted by topic author Ben Ben
‎12-08-2019 05:50 PM

Re: Event-options question ?

[ Edited ]
‎12-01-2019 07:29 PM

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

Highlighted
SRX Services Gateway

Re: Event-options question ?

[ Edited ]
‎12-02-2019 01:14 AM

Hi, Nelumbo,

 

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

 

Cheers




Highlighted
SRX Services Gateway

Re: Event-options question ?

‎12-08-2019 07:18 PM

Hello Ben,

 

Thanks, I am glad that helped.

 

Regards,

 

Nelumbo

Feedback