PowerSC

 View Only
  • 1.  Hide all events all endpoints

    Posted Wed May 18, 2022 03:41 AM
    Hello

    We are using PowerSC 2.0.0.2.

    Is it possible to execute "Hide all Events" on all Endpoints in PowerSC GUI or maybe at commandline?

    If LPARs get rebooted a "Agent Connectivity" Alert is raised. And during patching sometime also some alerts are raised.
    After a patchday I don't want to hide all events on 100+ endpoints.

    In the reports tab you also can only show on endpoint at a time and would have to hide it per endpoint.

    Thanks



    ------------------------------
    Stefan Koller
    ------------------------------


  • 2.  RE: Hide all events all endpoints

    Posted Tue May 31, 2022 02:33 PM

    Hi,

      There's currently no way through the UI to hide all events on all endpoints with a single click.  However, you can accomplish this via the REST API; for example using curl in a shell script.  Here's a command to hide all events for a single endpoint:

    # curl --user thill --insecure -X 'POST' \

    'https://129.40.40.86/ws/powerscui/blackboard?elementId=p52n73.pbm.ihost.com&hide=true' \

    -H 'accept: application/json'

     

    In the above:

    • The thill value for user should obviously be changed to a valid user on your PowerSC server system.  You'll be prompted for pw.
    • The 129.40.40.86 is the PowerSC server
    • elementId refers to the endpoint for which you want to hide events
    • The above command will Hide all events for that one server

     

    To do the same thing for ALL servers you'll need to set up a shell script that first collects all the endpoints, then loop thru them.  That can be done with the following call:
    curl –-user thill –-insecure -X 'GET' \

      'https://129.40.40.86/ws/powerscui/systems' \

      -H 'accept: application/json'

     

    • Again, changing thill to be your username and changing 129.40.40.86 to be your PowerSC server.
    • It returns a big json structure for each endpoint, but you can grab the bestName value and use it with the previous Hide command for each endpoint.

     

    We can write something for you that does all this in one script, but we don't currently have it and might take a while for us to get to it.  But wanted you to see that you can use those REST API commands to accomplish hiding all events on all endpoints.

     

    Tim



    ------------------------------
    Tim Hill
    ------------------------------



  • 3.  RE: Hide all events all endpoints

    Posted Wed June 01, 2022 11:37 AM
    Hi Tim

    Thanks a lot - The commands work. 
    I managed also to create a script to generate all command for all VMs.
    But of course I would have to enter my password for each instance.
    Do you have an idea how to solve that? maybe with a keyfile (if possible)? To place clear text a password into a script is not very nice.
    Or is it possible to create a user with very restricted permissions?
    You offered to write a script for us - this would be very nice.

    The ultimate solution would be having a "clear events on all VMs" button in the GUI. :-)

    Thanks a lot 
    Stefan

    ------------------------------
    Stefan Koller
    ------------------------------



  • 4.  RE: Hide all events all endpoints

    IBM Champion
    Posted Fri June 03, 2022 09:46 AM

    Hi Stefan,

      A certificate-based approach (to avoid the username/password stuff) might look something like:

    # openssl s_client -connect "${HOSTNAME}:${PORT}" </dev/null > "servercert.out.tmp"

         The hostname and port are where PSC is running

    # cat "servercert.out.tmp" | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > "servercert.crt"
    # rm "servercert.out.tmp"

          To strip off extraneous stuff and get just the cert content in a file

    then use

    # curl --cacert=servercert.crt… ....

    It's not completely secure because you're still self-validating the cert…but it's better than entering passwords.

    Tim



    ------------------------------
    Tim Hill
    ------------------------------



  • 5.  RE: Hide all events all endpoints

    Posted Fri November 18, 2022 09:35 AM
    Hello Tim
    But with this certificate I still need to provide a password for every curl command.
    I was thinking more about some automation user which uses something like a keyfile without password.

    Is this somehow possible? Otherwise I will write an expect script I can provide the PW and run it with curl -user USER:PW ...
    Then it is a least not in the shell history.
    stefan

    ------------------------------
    Stefan Koller
    ------------------------------



  • 6.  RE: Hide all events all endpoints

    Posted Mon November 21, 2022 11:40 AM
    Hi! Stephen, 

      You can create a .netrc file and include your credentials in that file. This file is owned by you only. You can use this file in  your Curl command.

    curl --netrc-file ~/.netrc https://example.com

    ------------------------------
    Bhargavi Reddy
    ------------------------------



  • 7.  RE: Hide all events all endpoints

    Posted Fri June 30, 2023 07:16 AM

    Just for everybody.

    In 2.1.0.5 they added a button to "Hide all Events" on all endpoints.

    congrats to the developer.



    ------------------------------
    Stefan Koller
    ------------------------------