DX Infrastructure Manager

Expand all | Collapse all

Setting Maintenance Mode on server using powershell

Jump to Best Answer
  • 1.  Setting Maintenance Mode on server using powershell

    Posted 07-01-2016 08:22 AM

    Hi all.

     

    Has anyone used powershell or command line action script to put one or more Servers into or out of maintenance mode?

    Our customer has a number of machines that have flexible shutdown times, so a static blackout period is not an option.

     

    Is it plausible to run a script from a hub to set times for in and out for one or more servers?

    Many thanks in advance for any help.



  • 2.  Re: Setting Maintenance Mode on server using powershell
    Best Answer

    Posted 07-01-2016 08:53 AM

    Hi,

        So as of UIM 8.X there are two maintenance modes.

    The first is the old controlled by the controller on each robot.

    You can use the following command to set this one

     

    Run command (that should have stopped the monitoring for 10 hours)

    <nimsoft>\bin\pu.exe -u administrator -p 'password' /domain/hub/robot/controller maint_until "" "36000" Reason for Outage" ""

     

    This disables all probes on the robot except the controller and re-enables them after the time period.

    The problem with this is that things such as logmon and ntevl that store a file position will pick up right were they left off.

    This can be a problem for some.

     

    The other is done through NAS and USM with the new maintenance mode:

    Perform Ad Hoc Maintenance - CA Unified Infrastructure Management - 8.0 - CA Technologies Documentation

     

    The new method can only be accessed via web either through USM portlet or rest API call.

     

    Advanced users who do not use USM can use REST-based web service calls to add or modify maintenance windows for devices. The following calls are available:

     

    add_schedule

    add_computer_systems_to_schedule

    remove_computer_systems_from_schedule

    modify_schedule

    delete_schedule

    add_computer_systems_to_active_window

    get_historical_maintenance_windows

    get_next_fire_time_for_schedules

    new_duration_for_active_window

    stop_maintenance

     

    See the CA Nimsoft RESTful Web Services Guide for more information about using RESTful Web Services.

     

    Hope this helps



  • 3.  Re: Setting Maintenance Mode on server using powershell

    Posted 07-15-2016 04:53 AM

    HI Gene.

    Many thanks for this. We will test to see if this can be scripted securely from a client-side request, as in they write and run the script.

    That's what testing is for!

    I will try and post feedback.



  • 4.  Re: Setting Maintenance Mode on server using powershell

    Posted 11-07-2016 09:31 AM

    Hi Gene!

     

    Can I use the same syntax to a linux machine?

    e.g.: /opt/nimsoft/bin/pu -u administrator -p 'password' /domain/hub/robot/controller maint_until "" "36000" Reason for Outage" ""

     

    Thank you.

     



  • 5.  Re: Setting Maintenance Mode on server using powershell

    Posted 11-07-2016 11:52 AM

    I don't foresee any problems using the same syntax on Linux.

    Regards

    -Sayeed