Monitoring Linux - Look for files RRS feed

  • Question

  • Hello!

    I have a ManagementPack for a Linux-Application where I have to discover the "Node-Name" of a running Application

    The command is.

    sh -c "find /app/instance/ -type f -name 'test-*.service' | sed -e 's#\(\/app\/instance\/\)\(.*\)\(\/test-.*\/.*\.service\)#\2#' | sort | uniq"



    But if SCOM is running the discovery, the command after first "|" is cutting. So I would get for result:


    I want to discover the Nodename in "test-node-1". Is their a problem with pipe in SCOM? Another discovery with a pipe I don't have any problems.



    • Edited by very_best Wednesday, May 13, 2020 12:32 PM
    Wednesday, May 13, 2020 12:30 PM

All replies

  • Hi,

    If the command contains multiple lines or special character, we may consider saving it in a .sh file and invoke it. For the similar scenario, we may refer to:

    SCOM 2012 - Linux Two-State Monitor With "Script In Script"
    Note: this is not from MS, just for your reference.

    Hope the above information helps.


    Alex Zhu
    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.
    Friday, May 15, 2020 12:13 AM
  • Hi Hansi,

    was Alex able to answer your question? We would really appreciate a short feedback! 

    Thanks in advance for that!


    (Please take a moment to "Vote as Helpful" and/or "Mark as Answer" where applicable. This helps the community, keeps the forums tidy, and recognizes useful contributions. Thanks!) Blog: https://blog.pohn.ch/ Twitter: @StoyanChalakov

    Monday, June 22, 2020 12:18 PM