ONTAP Discussions

How to make set adv, priv, diag with the rest of the command into one line of commnad.

sangyoon
4,826 Views

Hi All. I just wanted to find out if they can make the 'set [mode]' command with the rest of the command into one line of command. We are trying to monitor with the automated script so for them it would be a struggle if they have to separate those two lines when running the script. 

 

Would there be someway they can cheat or work around the way ? 

 

Best,

 

5 REPLIES 5

hmoubara
4,815 Views

Hello 

 

You should be able to use the ";" to separate multiple commands . As for the set command you can use the -c (confirmation) set to off.

 

Per example:

 

cluster::> set diag -c off; cluster ring show

 

Hope this answer your question.

 

Thanks 

parisi
4,773 Views

Correct. And don't worry about doing set admin/adv/diag. Just run them all from set diag.

akiendl
4,769 Views

I would strongly recommend to not run all as set diag. Diag mode has a number of things that are different on some commands and can cause you trouble. You should always go for least privilege needed. 

paul_stejskal
4,759 Views

I agree.

 

parisi
4,758 Views

When  using the CLI, sure. But when scripting them out, it doesn't really matter. You're not going to tab complete yourself into trouble. You'll run the same command you would in admin priv, just at diag level and it won't vary.

 

Diag commands are only different because you have extra flags you can run. They're not different simply because they're in diag priv.

Public