AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.

 View Only
  • 1.  AIX Toolbox and Filebeat

    Posted Wed February 24, 2021 04:29 PM

    Hi, I'm trying to create an AIX service to be able to deploy filebeat on all AIX system that we manage. The reason behind the service is to be idempotent with Ansible and be able to restart the service when its needed. So to be able to use the service module coming with Ansible that can handle startsrc, stopsrc and refresh. Anyone already done this ? Thx!



    #AIX
    #Support
    #SupportMigration


  • 2.  RE: AIX Toolbox and Filebeat

    Posted Wed February 24, 2021 04:32 PM

    This is where I'm at the moment.

    I also try to use signal 15 to normally terminate the process but it's not working. So I choose for now to only support stopsrc and startsrc with signal 9. It would be better to be able to support the correct signal and also support refresh -s filebeat.

    mkssys -s filebeat -u 0 -G beats -p "/opt/freeware/share/filebeat/bin/filebeat" -a "-path.home /opt/freeware/share/filebeat -path.config /opt/freeware/etc/filebeat -path.data /opt/freeware/var/lib/filebeat -path.logs /var/log/filebeat -p /opt/freeware/var/run/filebeat.pid" -S -n 9 -f 9

    #AIX
    #Support
    #SupportMigration


  • 3.  RE: AIX Toolbox and Filebeat

    Posted Fri April 23, 2021 10:37 AM
    • first. I do not think filebeat supports the -s flag. To use -s you need more than 'signals'
    • second: your `mkssys` statement is fine - but you do need to research why it is not responding to signal 15. Once you have found a signal (e.g., 1 aka SIGHUP) you could change that argument
    • Lastly, you should add some wrappers in /etc/rc.d/rc2.d/. For example: SXXfilebeat and KYYfilebeat that call startsrc and stopsrc for you when the system boots, or is shutdown. They can be linked - they are called with 'start' or 'stop' as $1.
    • For example:

    ```

    michael:[/etc/rc.d/rc2.d]cat S01sshd

    #!/bin/ksh

    # AIXTOOLS openssh start/stop

    ##################################################

    # name: S01sshd|K99sshd

    # purpose: script that will start or stop the sshd daemon.

    ##################################################

    case "$1" in

    start )

    startsrc -g ssh

    ;;

    stop )

    stopsrc -g ssh

    ;;

    * )

    echo "Usage: $0 (start | stop)"

    exit 1

    esac

    ```



    #AIX
    #Support
    #SupportMigration