散尽浮华 2023

過去心不可得,現在心不可得,未來心不可得。
安寻安放,不卑不亢;重剑无锋,大巧不工!
  1. 首页
  2. emc
  3. 正文

EMC DDVE:Python 远程查看告警 alerts show current

2019年1月13日 3635点热度 0人点赞 0条评论
# more ddve.py 
#!/usr/bin/python
# -*- coding: utf-8 -*-
# filename: pexpect_test.py

import threading
import paramiko
import subprocess
import sys

ip = "IP地址"
user = "sysadmin"
passwd = "密码"
client = paramiko.SSHClient()

client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(ip,22,username=user,password=passwd)

remote_connection = client.invoke_shell()
output = remote_connection.recv(1000)
print output

remote_connection.send("alerts show current\n");
output = remote_connection.recv(5000)
print output

[root@netman py]# python ddve.py 
Last login: Mon Dec 17 19:19:44 CST 2018 from 10.20.0.202 on gui

alerts show current

[root@netman py]# 
标签: 暂无
最后更新:2019年1月13日

admin

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

COPYRIGHT © 2023 散尽浮华 2023. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang