Put devices for a particular subnet into maintenance mode using command console.

  • Updated

Question:

Is there a way to put all devices inside particular subnet like 10.x.x.2/24 to maintenance mode from the API command console?

 

Answer:

Yes, you could do this. First lets just run through a couple of commands to make sure you can view what devices come back for that subnet. If you want to see what devices are in that subnet you can run the command:

mget * * sys ip4addr value 10.x.x.2/24 

If you want to see what is in the maintenance_mode group you can run the following:

mlist device any group maintenance_mode 

Once you have confirmed with the mget command, that you are getting the results you expect, you can then use the following command to put these devices into the maintenance_mode group:

assign * * sys ip4addr value 10.x.x.2/24 = maintenance_mode

Then use the mlist group above to confirm that these devices went into the maintenance_mode group.

When you need to clear those devices out of the maintenance_mode group you can use the following command:

clear * * sys ip4addr value 10.x.x.2/24 = maintenance_mode 

 

Note: If auto-grouping runs, since you put the devices into maintenance_mode group using the console, these devices will be taken out of the group. So be aware that if the auto-grouping runs then the devices will be taken out of this group. If you want them to stay in the group then you should use the auto-grouping page (Admin->Grouping->Auto-grouping) to assign these devices from the group. When you want to clear them, just comment out the assign in the auto-grouping and run the Auto-grouping again.

assign * * sys ip4addr value 10.x.x.2/24 = maintenance_mode

 

Was this article helpful?

/

Comments

0 comments

Please sign in to leave a comment.