DX Infrastructure Management

Expand all | Collapse all

Is it possible to stop/disable the robot watcher service from the REST Web Services API?

Jump to Best Answer
  • 1.  Is it possible to stop/disable the robot watcher service from the REST Web Services API?

    Posted 05-16-2018 08:52 AM

    I have this document http://docs.nimsoft.com/prodhelp/en_US/Monitor/SDK/REST/Nimsoft%20RESTful%20Webservices%20Manual%20and%20Reference%20Gui… 

     

    that shows me the different REST API Calls and examples with them.

     

    I do not see a call or an example of stopping the watcher service and disabling it? I am looking to automate this in our server decommission process. Is there a way to do this with the REST Webs services API?



  • 2.  Re: Is it possible to stop/disable the robot watcher service from the REST Web Services API?

    Posted 05-16-2018 08:57 AM

    Currently there is nothing currently built in to allow this.

    One way you might be able to do this is to deploy the nexec probe to a robot with a pre-configured profile

    to stop the robot service.

    then use the rest api probe call back to active the profile.

     

    there would be no way to start it back up though.



  • 3.  Re: Is it possible to stop/disable the robot watcher service from the REST Web Services API?

    Posted 05-16-2018 09:02 AM

    Well all I need to do is disable it. Because the server is being decommissioned. However sometimes during this process it will get rebooted a few times, and if the robot has been removed from UIM but the service is not stopped it will show back up in the IM and start to alert when its powered off again. 



  • 4.  Re: Is it possible to stop/disable the robot watcher service from the REST Web Services API?

    Posted 05-16-2018 09:17 AM

    I think it would be faster to login and disable the service than it would be to script anything or install a probe to do the work for you in the use case you described.



  • 5.  Re: Is it possible to stop/disable the robot watcher service from the REST Web Services API?

    Posted 05-16-2018 10:09 AM

    Gene

     

    If i was to set a profile in the nexec probe to stop and disable the service which I know I can do and placed it on the robots so it was there. Could I than run that profile from the nexec probe on any robot from the Webservices API?



  • 6.  Re: Is it possible to stop/disable the robot watcher service from the REST Web Services API?

    Posted 05-16-2018 11:05 AM

    you would need to the the rest probe call back to set the profile to active

    Probe Calls - CA Unified Infrastructure Management Probes - CA Technologies Documentation 

    and then use the call back to deactivate the probe and then activate it.

    would be a three steps process.

    but yes if each robot had the require nexec and script on it then you would be able to run the above command for that robot.



  • 7.  Re: Is it possible to stop/disable the robot watcher service from the REST Web Services API?
    Best Answer

    Posted 05-16-2018 12:58 PM

    Gene why would I need to mark it active and than deactivate and re-activate? Could I not just set a schedule for that profile to run every say 1 minute. That way when its activated a minute later the probe would run the profile and the robot service would become disabled
    ?



  • 8.  Re: Is it possible to stop/disable the robot watcher service from the REST Web Services API?

    Posted 05-16-2018 02:09 PM

    HI, yea I had not thought about that. but I would think that would work as well.



  • 9.  Re: Is it possible to stop/disable the robot watcher service from the REST Web Services API?

    Posted 05-19-2018 11:16 AM

    We addressed this by creating an archive package with nothing in it but two tabs, windows and linux filters on OS. the post install command on each is, respectively

     

    sc config "NimbusWatcherService" start= disabled & sc stop "NimbusWatcherService"

     

    ( /opt/nimsoft/bin/niminit stop ; /opt/nimsoft/bin/inst_init.sh remove )

     

    Then you can use REST to deploy the package to the desired robot you want to disable.

     

    Works too well so be careful. You get that disgruntled or careless employee that drops this at the domain level in IM and you're toast - one can only hope that the system with distsrv on it gets terminated early in the process or you have a lot of work to do to clean up.

     

    -Garin



  • 10.  Re: Is it possible to stop/disable the robot watcher service from the REST Web Services API?

    Posted 05-21-2018 08:48 AM

    Garin,

     

    Right that makes sense, I believe I have everything configured correctly accept the actual rest part. Right now using examples that are up from here:

     

    and Python scripts that have been tweaked for our environment I have them working like maintenance mode and probe inventory etc. I however have not been able to find an actual working example of how someone has used the rest API with the Set Single Probe Configuration Value. In the python examples I have from what has been created there is a function for "GET SINGLE Probe Configuration Value, however not one for SET Probe Configuration Value". So I am still working to try and create something so I can get this to work to where I can deploy the package.

     

    Do you possibly have an example powershell script or python script etc. for the "SET SINGLE prove configuration value" for the REST API Webservices of UIM?

     

    Thanks,

     

    Bob



  • 11.  Re: Is it possible to stop/disable the robot watcher service from the REST Web Services API?

    Posted 05-21-2018 11:52 AM

    I don't have anything in Perl or REST as an example but here's the Windows command line version of the controller callback:

     

    bin\pu.exe -u USERNAME -p PASSWORD controller probe_config_set ntperf "/watchers/WatcherName" "active" "no" ""

     

    You should be able to fire tht callback using:

     

    Probe Calls - CA Unified Infrastructure Management Probes - CA Technologies Documentation 

     

    -Garin



  • 12.  Re: Is it possible to stop/disable the robot watcher service from the REST Web Services API?

    Posted 06-19-2018 09:13 AM

    Garin

     

    /opt/nimsoft/bin/niminit stop ; /opt/nimsoft/bin/inst_init.sh remove

     

    The first command you gave does work the second does not for us in RHEL. Is there a command to disable the nimbus service in RHEL?

     



  • 13.  Re: Is it possible to stop/disable the robot watcher service from the REST Web Services API?

    Posted 06-19-2018 10:07 PM


  • 14.  Re: Is it possible to stop/disable the robot watcher service from the REST Web Services API?

    Posted 06-20-2018 08:42 AM

    /etc/init.d/nimbus is what stops the service however when running the command by hand I need to sudo in order to run it.

     

    That being said if I use the nexec probe I get this error: "Failed to stop nimbus.service: Interactive authentication required.See system logs and 'systemctl status nimbus.service' for details."

    So I am not quite sure how I can run this or what user actually runs the command to add it to a sudoers list?? Or any other suggestions would be welcome as well .



  • 15.  RE: Re: Is it possible to stop/disable the robot watcher service from the REST Web Services API?

    Posted 11-04-2019 02:37 PM
    Hi Garin,
    I'm trying to create this package and getting issues as well. I setup 3 tabs, one for updating the robot tags, then Windows | Linux tab.
    Windows Tab > Miscellaneous Tab:
    Post Install Command:
    sc config "NimbusWatcherService" start=disabled & sc stop "NimbusWatcherService"

    Tried deploying to a test robot box and didn't work. Controller log getting:
    Nov 4 12:32:41:161 [9464] 3 Controller: inst_execute: install section Win-Remove in package __Uninstall_Robot__
    Nov 4 12:32:41:161 [9464] 2 Controller: copy_file - copying robot/pkg/inst/installed.pkg to robot/pkg/inst/installed.pkg-
    Nov 4 12:32:41:161 [9464] 2 Controller: MyStringExpand (sc config "NimbusWatcherService" start= disabled & sc stop "NimbusWatcherService")...
    Nov 4 12:32:41:161 [9464] 2 Controller: Preparing to run post-install 'sc config "NimbusWatcherService" start= disabled & sc stop "NimbusWatcherService"'
    Nov 4 12:32:41:192 [9464] 2 Controller: post-install 'sc config "NimbusWatcherService" start= disabled & sc stop "NimbusWatcherService"' started
    Nov 4 12:32:41:208 [9464] 3 Controller: inst_execute: sending reply rc=0(OK)
    Nov 4 12:32:41:239 [9464] 1 Controller: inst_file_start - package=__Uninstall_Robot__, file=robot.cfx, type=config
    Nov 4 12:32:41:270 [9464] 1 Controller: inst_file_end - package=__Uninstall_Robot__, file=robot.cfx, bytes=111
    Nov 4 12:32:41:286 [9464] 3 Controller: RREQUEST: inst_ready <-10.244.10.92/53284 h=293 d=0 fd=728
    Nov 4 12:32:41:286 [9464] 2 Controller: Process 'sc config "NimbusWatcherService" start= disabled & sc stop "NimbusWatcherService"' (11444) is finished
    Nov 4 12:32:41:286 [9464] 0 Controller: post-install 'sc config "NimbusWatcherService" start= disabled & sc stop "NimbusWatcherService"' returned 1639

    1639 is a permission related issue.

    Since MSP's will definitely run across some permission issues when trying to run any commands what if we just switch the robot to 'passive' mode?

    Can someone explain what exactly is 'passive' mode? Since the old doc site is down and the new site you cannot search I can't find anything to reference on what exactly 'passive' means?

    On the test box above, i set it to passive and its now gone from IM. Where did it go?  I've never dealt with robot mode passive only normal. In what situations would you use 'passive'?

    ------------------------------
    Daniel Blanco
    Enterprise Tools Architect
    Alphaserve Technologies
    ------------------------------



  • 16.  RE: Re: Is it possible to stop/disable the robot watcher service from the REST Web Services API?

    Posted 11-04-2019 02:44 PM
    Select Passive mode if you want the robot to hold its messages until the hub requests them.

    Search on the new techdocs site is working. 


    ------------------------------
    Support Engineer
    Broadcom
    ------------------------------



  • 17.  RE: Re: Is it possible to stop/disable the robot watcher service from the REST Web Services API?

    Posted 11-04-2019 02:46 PM
    A passive robot does not initiate contact with the hub.
    The hub has to have a static mapping to the passive robot.
    And the hub handles all of the communication requests.

    you can set the
    robot_mode = passive
    or remove the line

    ------------------------------
    Gene Howard
    Principal Support Engineer
    Broadcom
    ------------------------------



  • 18.  RE: Re: Is it possible to stop/disable the robot watcher service from the REST Web Services API?

    Posted 11-04-2019 03:06 PM
    Edited by Daniel Blanco 11-04-2019 03:10 PM
    So what exactly is the point of a passive robot? When would folks use a passive robot?
    Also if a robot is set to passive, you can't deploy anything to them, nor control them.
    Hub options are only:  Restart, Check, Remove

    So in the goal of trying to remove a robot from IM, if the commands above won't work b/c client permission issues and other reasons, if we have no access to the target box would setting the robot to passive after removing all probes off that box be the only option then to just remove that box from UIM?

    ------------------------------
    Daniel Blanco
    Enterprise Tools Architect
    Alphaserve Technologies
    ------------------------------



  • 19.  RE: Re: Is it possible to stop/disable the robot watcher service from the REST Web Services API?

    Posted 11-04-2019 03:10 PM
    A passive robot is intended for environments where the robot cannot initiate any outbound communication across the network/internet, but the hub is able to initiate inbound contact.  The robot, instead of sending 'alive' messages to the hub every so often and registering its existence, will sit and wait for the hub to contact it and issue it commands.


  • 20.  RE: Re: Is it possible to stop/disable the robot watcher service from the REST Web Services API?

    Posted 11-04-2019 03:21 PM
    Thanks Jason.
    So am I seeing this correctly: passive robots don't show up in the IM tree nor in Admin console? They only reference to them would be in that passive robots hubs hub's probes Robot tab.
    How then do you deploy anything to that robot or get alerts from that robo then?



    ------------------------------
    Daniel Blanco
    Enterprise Tools Architect
    Alphaserve Technologies
    ------------------------------



  • 21.  RE: Re: Is it possible to stop/disable the robot watcher service from the REST Web Services API?

    Posted 11-04-2019 03:26 PM
    It has been awhile but I believe that after adding the passive robot to the hub, if you re-login to IM you should see that robot listed.


  • 22.  RE: Is it possible to stop/disable the robot watcher service from the REST Web Services API?

    Posted 11-04-2019 03:14 PM
    HUB robot in passive mode
    https://ca-broadcom.wolkenservicedesk.com/external/article?articleId=34292

    ------------------------------
    [Designation]
    [City]
    ------------------------------



  • 23.  RE: Is it possible to stop/disable the robot watcher service from the REST Web Services API?

    Posted 11-04-2019 04:13 PM
    Thanks Steve, Jason.
    I don't want to thread jack this thread but I don't think it's working right. I followed that doc.

    Manually added the robot running in passive mode but it just turns yellow, then black in the hubs robot list.


    Then when I close the hub and re-open its gone from the list.
    I made sure the ports are fully opened on that box to the hub as well. Before it was passive I was opening the controller probe on that box w/o any issues.


    Anyway setting the robot to 'passive' would be the work around here for this "How to remove robot". Its gone from IM and we don't get alerted on that box any longer. Once you stop/remove all probes on that box and set to passive its essentially gone.
    The package I created and used:

    <controller> overwrite
    os_user1 = THIS ROBOT IS DELETED
    os_user2 = REMOVED FROM MONITORING
    autoremove = yes
    robot_mode = passive
    </controller>

    Thanks.

    ------------------------------
    Daniel Blanco
    Enterprise Tools Architect
    Alphaserve Technologies
    ------------------------------



  • 24.  RE: Is it possible to stop/disable the robot watcher service from the REST Web Services API?

    Posted 11-06-2019 12:25 PM
    Hi Dan,

    I get the same/similar end result/error as of UIM v9.20. I'm going to open a case and follow up with Development on this issue.

    Steve

    ------------------------------
    Support Engineer
    Broadcom
    US
    ------------------------------