Our bike or scripts that make admin life easier

    image
    In the comments to one of the previous articles, there was a request to put on public display all of our achievements used in everyday life. Together, everything was collected, described and posted on github.
    Under the cat link to the repository and a brief description of the scripts.


    Link to the repository: github.com/olemskoi/centos-admin
    Here is a brief description of the scripts and how to work with them.

    1. admin.sh

    use ./admin.sh [ip]

    Creates a site for the site according to the template. That is, nginx apache configs, makes a reload of services and creates a mysql and / or postgresql database. Depending on the availability of the file /root/.mysql /root/.postgresql.
    It also creates an FTP account based on pure-ftpd.
    Access information is displayed in STDOUT.

    use ./admin.sh Creates a database. Access information is displayed in STDOUT.

    use ./admin.sh

    Changes the superuser password.

    2. apache-top.py, apachetop.sh

    A script showing apache requests in real time.
    Requires some configuration nginx:
    location / apache-status {
    proxy_pass 127.0.0.1 : 8080;
    proxy_redirect off;
    proxy_set_header Host $ host;
    proxy_set_header X-Real-IP $ remote_addr;
    proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for;

    proxy_read_timeout 300;
    client_max_body_size 256m;

    proxy_buffer_size 16k;
    proxy_buffers 32 16k;
    }
    As well as apache settings:
    ServerName localhost


    Sethandler server-status


    3. cacti-php-fpm.sh

    Script for configuring web services for php-fpm monitoring in cacti

    4. highload-report.sh

    The script collects complete information about the system at a particular time and sends information to the mail:
    *) list of processes, sorting by CPU
    *) list of processes, sorting by MEM
    *) list of mysql queries
    *) list of apache queries
    *) list of nginx queries
    *) list netstat connections sorted by ip
    *) of all TCP / UDP sessions
    *) mysql status

    The script starts monit when la> X

    5. httpd-restart.sh

    Just restart apache, needed for monit

    6. maldet.sh

    A script to check sites for viruses, uses maldet

    7. mongodb-backup.sh

    MongoDB backup script. Made based on mysql-backup.sh

    8. mysql-backup.sh

    Backup mysql. Detailed description in this article

    9. mysql-slave-check.sh

    The script checks the status of mysql slave with a notification.

    10. mysql-table-check.sh

    Table Validation Script

    11. php-cron.sh

    Script to add php cron tasks

    12. postfix.sh

    Stop / start postfix, needed for monit.

    13. postgresql-backup.sh

    Postgresql backup script. It works in the same way as mysql-backup.sh with the exception of special features.

    14. redis-backup.sh

    The backup script redis. It works in the same way as mysql-backup.sh with the exception of special features.

    15. redis-ping.sh

    Redis liveliness test script.

    16. rstr-xtra-mysql.sh

    Script for working with mysql xtrabackup

    17. unicornstat.pl, unicornstat.sh

    The script for obtaining statistics on the work of unicorn

    18. vz-exec.pl

    Script for managing openvz containers via ssh

    Also popular now: