Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Info
It may be necessary to modify a special agent shipped with checkmk. Please don't modify the original files. You will lose any modifications after an upgrade.

Table of Contents

Step-by-step guide

  1. Log on via SSH and become the siteuser

    Code Block
    languagebash
    themeRDark
    root@linux# su mysite


  2. Copy the agent to the local structure

    Code Block
    languagebash
    themeRDark
    OMD[mysite]~$:cp ~/lib/python3/cmk/special_agents/<script>.py ~/local/share/check_mk/agents/special/


  3. Make the script executable

    Code Block
    languagebash
    themeRDark
    OMD[mysite]~$:chmod +x ~/local/share/check_mk/agents/special/<script>.py 


  4. Append the following line to the end of the script using Vim.

    Code Block
    languagebash
    themeRDark
    OMD[mysite]~$: vim ~/local/share/check_mk/agents/special/<script>.py


    Code Block
    languagebash
    themeRDark
    if __name__ == "__main__":
        main()


Info

https://realpython.com/python-main-function/#use-if-__name__-__main__-to-control-the-execution-of-your-code

Filter by label (Content by label)
showLabelsfalse
max5
spacesCON
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel = "special_agent" and type = "page" and space = "CON"
labelsspecial_agent


Page Properties
hiddentrue


Related issues