Open valerarar opened 3 years ago
Where find logs for alert
This depends on your logging configuration. The script sends the alerts with info
severity level under external
facility. For example, if you are logging into the messages
file, then the configuration below works:
root@CE-A> show configuration system syslog file messages
any notice;
authorization info;
external info;
explicit-priority;
root@CE-A>
As seen above, for the info
and higher severity level messages for facility external
are logged into the messages
(/var/log/messages
) file. Example of an alert message can be seen below:
root@CE-A> show log messages | match utilization | last 1
Jan 20 15:47:55 CE-A cscript.crypto: %EXTERNAL-6: bwutil.slax: ingress & egress bandwidth utilization exceeds 10% on interface ge-0/0/0.0
root@CE-A>
However, the content of your /var/tmp/bwutil/octets_IfIndex554
file is incomplete. The first field(epoch timestamp) is empty. Can you please post the output of show system uptime | display xml
? Or did you copy a partial output of the /var/tmp/bwutil/octets_IfIndex554
file?
In addition, as your et-0/0/8.0
interface is a 25Gbps one, then you need to generate at least 250Mbps of traffic in either direction in order to trigger the alert message if you set the threshold to 1%.
Thanks for the answer Syslog:
show configuration system syslog | display set
set system syslog archive size 10m
set system syslog archive files 5
set system syslog archive world-readable
set system syslog user * any emergency
set system syslog host 172.16.xxx any any
set system syslog host 172.16.xxx authorization any
set system syslog host 172.16.xxx external info
set system syslog host 172.16.xxx log-prefix ds-leaf-test
set system syslog file messages any notice
set system syslog file messages authorization any
set system syslog file messages external info
set system syslog file messages archive world-readable
set system syslog file messages explicit-priority
show log messages| match utilization and in syslog host - empty
show system uptime | display xml
<rpc-reply xmlns:junos="http://xml.juniper.net/junos/19.4R0/junos">
<multi-routing-engine-results>
<multi-routing-engine-item>
<re-name>localre</re-name>
<system-uptime-information xmlns="http://xml.juniper.net/junos/19.4R0/junos">
<current-time>
<date-time junos:seconds="1611236300">2021-01-21 16:38:20 MSK</date-time>
</current-time>
<time-source> NTP CLOCK </time-source>
<system-booted-time>
<date-time junos:seconds="1603208029">2020-10-20 18:33:49 MSK</date-time>
<time-length junos:seconds="8028271">13w1d 22:04</time-length>
</system-booted-time>
<protocols-started-time>
<date-time junos:seconds="1603208062">2020-10-20 18:34:22 MSK</date-time>
<time-length junos:seconds="8028238">13w1d 22:03</time-length>
</protocols-started-time>
<last-configured-time>
<date-time junos:seconds="1611162160">2021-01-20 20:02:40 MSK</date-time>
<time-length junos:seconds="74140">20:35:40</time-length>
<user>admin</user>
</last-configured-time>
<uptime-information>
<date-time junos:seconds="1611236300">4:38PM</date-time>
<up-time junos:seconds="8028300">92 days, 22:05</up-time>
<active-user-count junos:format="2 users">2</active-user-count>
<load-average-1>0.28</load-average-1>
<load-average-5>0.32</load-average-5>
<load-average-15>0.27</load-average-15>
<user-table></user-table>
</uptime-information>
</system-uptime-information>
</multi-routing-engine-item>
</multi-routing-engine-results>
<cli>
<banner>{master:0}</banner>
</cli>
</rpc-reply>
cat /var/tmp/bwutil/octets_IfIndex554
,258260945,879482159,25000%
Port is loaded with 1Gbit/s one way
Looks like the QFX series switches and probably some other platforms like SRX series firewalls in cluster mode return the <system-uptime-information>
under the <multi-routing-engine-item>
hierarchy. I updated the script. Please test with the latest revision of bwutil.slax
.
And
But I'm not sure if an alert is triggered for an exceeding event, I set 1%
Model: qfx5120-48y-8c Junos: 19.4R3.11 flex