简体   繁体   English

如何简化以后在NetApp 7-模式下的解析?

[英]How to ease later parse on NetApp 7-Mode?

I would like to parse and extract useful information from several Netapp commands output such as sysconfig , uptime and so on. 我想从一些Netapp命令输出中解析和提取有用的信息,例如sysconfiguptime等。

I had already done it on Netapp Clustered Mode (C-Mode) because set command made my life much easier with this kind of sentences: 我已经在Netapp群集模式(C-Mode)上完成了此操作,因为使用set语句使我的生活变得更加轻松:

  • Custom delimiter character: 自定义分隔符:

     set -showseparator '!'; 
  • Unlimited terminal lenght. 无限的终端长度。

     set -rows 0; 
  • Show all fields 显示所有领域

     set -showallfields true; 

However, set command does not exist in Netapp 7-Mode. 但是, set命令在Netapp 7模式中不存在。 ¿Does any one know something similar to modify the terminal length, units, field separator? ¿是否有人知道类似的修改端子长度,单位和字段分隔符的内容?

This is the version I have in hands: 这是我手头的版本:

3250-01> version
NetApp Release 8.1.2P4 7-Mode: Fri Apr 26 19:57:25 PDT 2013

There is no similar functionality in 7-mode. 7模式下没有类似的功能。 You have to parse the output. 您必须解析输出。 It's not too bad for some commands (like df or version ) but others have formatting, and it gets very messy (like aggr show_space and vol status ) 对于某些命令(例如dfversion )来说还不错,但其他命令具有格式,并且变得非常凌乱(例如aggr show_spacevol status

The closest you get is to make API calls and parse resultant XML. 最接近的是进行API调用并解析生成的XML。 That's a bit more complicated, but I've got some example code of how it might work. 有点复杂,但是我有一些示例代码说明了它如何工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM