Ad Widget

Collapse

Install zabbix agent on Solaris 10

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 2hard
    Junior Member
    • Feb 2014
    • 1

    #1

    Install zabbix agent on Solaris 10

    I was try to configure zabbix agent on Solaris 10 but not succesfull. I follow this instruction https://www.zabbix.com/wiki/howto/install/solaris. But got stuck when i running this script /etc/init.d/zabbix_agentd .
    And i got this error message "/etc/init.d/zabbix_agentd: syntax error at line 21: `(' unexpected" . Please help me.
    Or maybe someone can provide another way to install zabbix agent on Solaris10


    Many thanks before
  • aib
    Senior Member
    • Jan 2014
    • 1615

    #2
    I'm not sure about Solaris, but in CentOS this file contains the text script for start/stop/restart zabbix_agentd which saved in /usr/sbin/zabbix_agentd executable file.

    As it is a text file you can use command like:
    Code:
    cat -n /etc/init.d/zabbix_agentd | more
    to check which line give you the error message.

    Also if you are going to install a lot of Solaris 10 agents you can check the article: Zabbix agent package for Solaris 10/ to make your own package.
    Sincerely yours,
    Aleksey

    Comment

    • NE1Scott
      Member
      • Jan 2021
      • 49

      #3
      Based on what I saw a few others post I found them lacking alot of the detail I needed to "actually" get it all installed and functioning to start on boot.
      I am posting my version that I have been using to install my Solaris 10/11 systems.
      -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      Download the pre-compiled zabbix agent for Solaris 10 or 11 fromhttps://www.zabbix.com/download_agents
      I downloaded "zabbix_agent-4.4.4-solaris-10-amd64-openssl.tar.gz" for Solaris 10
      I downloaded "zabbix_agent-4.4.4-solaris-11.3-amd64-openssl.tar.gz" for Solaris 11

      Create a temp folder /ztemp and put the file in there using WinScp /scp or whatever method you’d like.

      Unzip and then extract the files using : (Use the filename you downloaded for Solaris 10/11)
      gunzip /ztemp/zabbix_agent-4.4.4-solaris-10-amd64-openssl.tar.gz
      tar -xvf /ztemp/zabbix_agent-4.4.4-solaris-10-amd64-openssl.tar

      You will have the following folders
      sbin/
      bin/
      conf/

      Now move the content of the files to the proper system folders :
      mkdir /etc/zabbix
      mv /ztemp/conf/zabbix_agentd.conf /etc/zabbix/
      mv /ztemp/conf/zabbix_agentd /etc/zabbix/
      mv /ztemp/bin/zabbix_sender /bin/
      mv /ztemp/bin/zabbix_get /bin/
      mv /ztemp/sbin/zabbix_agentd /sbin/

      Edit the /etc/zabbix/zabbix_agentd.conf to point to your Zabbix server :
      Server=IP of your Zabbix Server
      Hostname=Your host name (Don't use this if you use passive agent only)
      Create a zabbix user on the system since running as root is not allowed :
      useradd zabbix

      Create a Zabbix start/stop script in /etc/init.d/
      vi /etc/init.d/zabbix and paste the following :
      #!/sbin/sh
      # Script to start Zabbix Agent on boot

      state="$1"

      case "$state" in
      'start')
      echo 'Starting Zabbix Agent'
      /sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
      ;;

      'stop')
      echo 'Stopping Zabbix Agent'
      /usr/bin/pkill -9 zabbix
      ;;

      *)
      echo "Usage: $0 { start | stop }"
      exit 1
      ;;
      esac
      exit 0

      Change the permissions on the file using :
      chmod 744 /etc/init.d/zabbix
      chgrp sys /etc/init.d/zabbix

      Link this file to the proper start/stop runlevel directories using :
      ln -s /etc/init.d/zabbix /etc/rc3.d/S99zabbix
      ln -s /etc/init.d/zabbix /etc/rc0.d/K99zabbix

      Start the Zabbix Agent using your script with :
      /etc/rc3.d/S99zabbix start

      Add this host to your Zabbix server monitoring using the proper template and you're done.
      Template OS Solaris (Template Module Zabbix agent)
      Last edited by NE1Scott; 13-02-2021, 00:20. Reason: Added Solaris 11 after finding it was the same exact procedure.

      Comment

      Working...