In some scenario, we need to monitor some data in router/switch by automation. This article will show example that how to check share memory utilization. And you can easy to change the script base on your requirement/scenario.
Prepare
Due to “telnetlib” couldn’t exactly check expect messages by read_until() function (that couldn’t control exactly time when the info return to buffer), so I change to “expect”. And follow Bo’s example Python Expect Demo, and there is a good documents for expect demo from IBM too: 探索 Pexpect,第 2 部分:Pexpect 的实例分析 完整阅读
After installed Centos 6.7 for CISCO WAE, I found python version is 2.6 that is much older, and I need ansible1.9, but Centos default upgrade to ansible2.2… in order to easy management ansible1.9 that is python package, I plan to install PIP. From official website, suggest not use 2.6 under pip, so I need to upgrade python to 2.7 too.
But I found WAE use 2.6 after I succeed upgrade python to 2.7…Summarized the totally steps that will help me review in future.
MacOS:Documents frank$ cd citra/
MacOS:citra frank$
MacOS:citra frank$
MacOS:citra frank$ export Qt5_DIR=$(brew --prefix)/opt/qt5
MacOS:citra frank$ export MACOSX_DEPLOYMENT_TARGET=10.9
MacOS:citra frank$ mkdir build
MacOS:citra frank$ cd build
MacOS:build frank$ cmake .. -GXcode
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:36 (project):
No CMAKE_C_COMPILER could be found.
CMake Error at CMakeLists.txt:36 (project):
No CMAKE_CXX_COMPILER could be found.
-- Configuring incomplete, errors occurred!
See also "/Users/frank/Documents/citra/build/CMakeFiles/CMakeOutput.log".
See also "/Users/frank/Documents/citra/build/CMakeFiles/CMakeError.log".
class Person
{
int age ;
String name; //实例变量,也叫对象变量
static int totalFee; //静态变量,也叫类变量
//类变量是所有对象共有,一个对象将它改变,其他对象得到的就是改变后的
//而实例变量则属对象私有,某一个对象将其值改变,不影响其他对象
public void showName()
{
System.out.print(this.name);
}
public static void showTotalFee()
//类方法是属于与类相关的,公共的方法
{
System.out.print(totalFee);
}
}