![]() Here is another example which demonstrates how the script is used to kill a process as soon as the memory crosses the specified threshold. ![]() Nexus(config-schedule)# show proc cpu | i ptp Python Nexus# python bootflash:ptp_alert_mem_cpu.py ptpĢ018 Dec 13 10:59:30 Nexus %VSHD-5-VSHD_SYSLOG_CONFIG_I: Configured from vty by admin on vsh.28744Ģ018 Dec 13 11:02:30 Nexus %VSHD-5-VSHD_SYSLOG_CONFIG_I: Configured from vty by admin on vsh.28867Ģ018 Dec 13 11:03:37 Nexus %EEM_ACTION-5-NOTIF: for ptp mem: 649089024 and cpu 0.00%Īs seen here, this syslog alert is triggered for the PTP process and includes CPU and memory usage. Use this section in order to confirm that your configuration works properly. Ptp_mem = cli('sh proc mem | i '+process)Ĭli('syslog priority notifications msg for '+process+' mem: '+mem +' and cpu ' + cpu) Ptp_cpu = cli('sh proc cpu | i '+process) The python script is used to monitor the CPU and memory for a particular process that runs on the device. Configureįor this example, monitor the process PTP for its CPU and Memory. If your network is live, make sure that you understand the potential impact of any command. All of the devices used in this document started with a cleared (default) configuration. The information in this document was created from the devices in a specific lab environment. ![]() The information in this document is based on these software and hardware versions: Prerequisites RequirementsĬisco recommends that you have knowledge of these topics: This document describes how to monitor CPU and memory with the use of the inbuilt python cli module and schedule syslog notifications. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |