Skip to content

Commit

Permalink
Add Zabbix template.
Browse files Browse the repository at this point in the history
  • Loading branch information
qinyangming.qym committed Nov 16, 2023
1 parent c4661c5 commit 7069593
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 0 deletions.
1 change: 1 addition & 0 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ ROS 模板的示例和最佳实践。模板分类如下:
| [database/polardb-migration-from-rds.yml](./solutions/database/polardb-migration-from-rds.yml) | 解决RDS MySQL或自建MySQL遇到的性能或容量瓶颈,迁移上下PolarDB链路打通。 |
| [database/deploy-mysql-based-on-ebs.yml](./solutions/database/deploy-mysql-based-on-ebs.yml) | 基于EBS ESSD部署高性能的MySQL服务。 |
| [devops/container-application-devops-for-ack-cluster.yml](./solutions/devops/container-application-devops-for-ack-cluster.yml) | DevOps的目的是构建一种文化和环境,使构建,测试,发布软件更加快捷,频繁和可靠。而到了容器时代,需要部署的机器不但量更大,变化更剧烈,有的甚至需要根据条件自动升缩,为了满足企业敏捷的需求,持续部署也成了必须,本方案使用云效完成容器应用(小程序后端服务)的自动化构建和持续部署。 |
| [devops/deploy-zabbix-service.yml](./solutions/devops/deploy-zabbix-service.yml) | Zabbix是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案,用于监测和跟踪各种IT基础设施组件的性能、可用性和健康状态。|
| [enterprise-on-cloud/create-ddh-and-deploy-cloud-server.yml](./solutions/enterprise-on-cloud/create-ddh-and-deploy-cloud-server.yml) | 介绍本地部署或托管在IDC环境的 VMware系统迁移上云至独立宿主机(DDH)的最佳实践。使用DDH在云端构建由独享物理服务器组成的资源池,同时配合ECS成熟稳定的虚拟化技术体系,充分利用云上资源弹性、按使用付费的优势,快速构建高性能、高可靠和可快速动态伸缩的虚拟化系统,满足安全、合规、自定义部署、自带许可证(BYOL)等企业级需求;此模板完成创建DDH并部署云服务器。 |
| [enterprise-on-cloud/e-commerce-business-and-db-on-the-cloud.yml](./solutions/enterprise-on-cloud/e-commerce-business-and-db-on-the-cloud.yml) | 此模板可创建出电商资源建站和数据库迁移方案所需资源,属于企业上云的最佳实践之一。 |
| [enterprise-on-cloud/games-or-retail-single-db-single-service.yml](./solutions/enterprise-on-cloud/games-or-retail-single-db-single-service.yml) | 在创业型公司或阿米巴模式经营的公司,新项目发布初期存在较大的不确定性,既要考虑项目未来的扩展性,又要衡量项目的运营成本。本解决方案为客户提供低成本,敏捷快捷的最佳实践。适用典型行业:游戏、零售等行业。 |
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ Examples and best practices of ROS templates. The templates are categorized as f
| [data-migration/self-built-hive-data-warehouse-migrated-to-emr.yml](./solutions/data-migration/self-built-hive-data-warehouse-migrated-to-emr.yml) | This solution uses ROS to create an on-premises Hadoop cluster and migrate the cluster data to an Alibaba Cloud E-MapReduce cluster. |
| [database/polardb-migration-from-rds.yml](./solutions/database/polardb-migration-from-rds.yml) | This template is used to migrate data from an ApsaraDB RDS for MySQL database or a self-managed MySQL database to a PolarDB for MySQL cluster. |
| [devops/container-application-devops-for-ack-cluster.yml](./solutions/devops/container-application-devops-for-ack-cluster.yml) | This template uses DevOps to automate the building of container applications or mini programs and facilitate continuous delivery. DevOps is a combination of best practices and tools that help enterprises deliver applications and services at high velocity. In the era of containers, the number of deployed applications grows larger. These applications also change faster, with some applications having requirements on autoscaling. To meet the requirements on agile deployment, continuous delivery is critical. |
| [devops/deploy-zabbix-service.yml](./solutions/devops/deploy-zabbix-service.yml) | Zabbix is a Web-based, enterprise-grade, open source solution that provides distributed system monitoring and network monitoring capabilities to monitor and track the performance, availability, and health of various IT infrastructure components. |
| [enterprise-on-cloud/create-ddh-and-deploy-cloud-server.yml](./solutions/enterprise-on-cloud/create-ddh-and-deploy-cloud-server.yml) | This template demonstrates the best practices for migrating VMware systems that are deployed or hosted in an on-premises data center to DDH. You can use DDH to build a resource pool composed of dedicated physical servers on the cloud, and use ECS to take full advantage of the resource elasticity and pay-as-you-go billing model on the cloud. This way, you can build a highly reliable and scalable high-performance virtualization system that can meet enterprise-level requirements such as security, compliance, custom deployment, and Bring Your Own License (BYOL). This template helps create a dedicated host and deploy ECS instances. |
| [enterprise-on-cloud/e-commerce-business-and-db-on-the-cloud.yml](./solutions/enterprise-on-cloud/e-commerce-business-and-db-on-the-cloud.yml) | This template can create the resources required for e-commerce website building and database migration solutions. It serves as one of the best practices for enterprises to migrate to the cloud. |
| [enterprise-on-cloud/games-or-retail-single-db-single-service.yml](./solutions/enterprise-on-cloud/games-or-retail-single-db-single-service.yml) | This template demonstrates the best practices to migrate a single database on a server to the cloud at low costs and in an agile manner. This template is suitable for startups or companies in the retail and gaming industries, and companies that operate in the amoeba model that want to improve their scalability and minimize their operating costs. |
Expand Down
131 changes: 131 additions & 0 deletions solutions/devops/deploy-zabbix-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 一键部署Zabbix。
en: Deploy Zabbix with one click.
Parameters:
ZoneId:
Type: String
Label:
zh-cn: 可用区ID
en: Zone ID
AssociationProperty: 'ALIYUN::ECS::Instance::ZoneId'
EcsInstanceType:
Type: String
Label:
zh-cn: 实例类型
en: Instance Type
AssociationProperty: 'ALIYUN::ECS::Instance::InstanceType'
AssociationPropertyMetadata:
ZoneId: ${ZondId}
InstanceChargeType: PostPaid
Resources:
Vpc:
Type: 'ALIYUN::ECS::VPC'
Properties:
CidrBlock: 192.168.0.0/16
SecurityGroup:
Type: 'ALIYUN::ECS::SecurityGroup'
Properties:
VpcId:
Ref: Vpc
SecurityGroupIngress_80:
Type: 'ALIYUN::ECS::SecurityGroupIngress'
Properties:
SecurityGroupId:
Ref: SecurityGroup
IpProtocol: tcp
NicType: intranet
SourceCidrIp: 0.0.0.0/0
PortRange: 80/80
VSwitch:
Type: 'ALIYUN::ECS::VSwitch'
Properties:
ZoneId:
Ref: ZoneId
VpcId:
Ref: Vpc
CidrBlock: 192.168.0.0/24
InstanceGroup:
Type: 'ALIYUN::ECS::InstanceGroup'
Properties:
ZoneId:
Ref: ZoneId
VpcId:
Ref: Vpc
VSwitchId:
Ref: VSwitch
SecurityGroupId:
Ref: SecurityGroup
ImageId: centos_7
SystemDiskCategory: cloud_essd
IoOptimized: optimized
InstanceType:
Ref: EcsInstanceType
MaxAmount: 1
InstallZabbix:
Type: 'ALIYUN::ECS::RunCommand'
Properties:
InstanceIds:
'Fn::GetAtt':
- InstanceGroup
- InstanceIds
Type: RunShellScript
CommandContent:
'Fn::Sub': |-
sudo rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
sudo yum clean all
sudo yum makecache
sudo yum install zabbix-server-mysql zabbix-agent -y
sudo yum install centos-release-scl -y

sudo sed -i 's/^enabled=0/enabled=1/' /etc/yum.repos.d/zabbix.repo
sudo yum install zabbix-web-mysql-scl zabbix-apache-conf-scl -y

sudo yum install mariadb-server -y
sudo systemctl start mariadb
sudo systemctl enable mariadb
sudo mysql_secure_installation <<EOF

y
zabbix
zabbix
y
n
y
y
EOF
sudo mysql -uroot -pzabbix -e "CREATE DATABASE zabbix character set utf8 collate utf8_bin;"
sudo mysql -uroot -pzabbix -e "CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'zabbix';"
sudo mysql -uroot -pzabbix -e "GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost';"
sudo mysql -uroot -pzabbix -e "FLUSH PRIVILEGES;"
sudo zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -pzabbix zabbix
sudo sed -i 's/^# DBPassword=/DBPassword=zabbix/' /etc/zabbix/zabbix_server.conf
sudo sed -i 's/^; php/php/' /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
sudo sed -i 's/Europe\/Riga/Asia\/Shanghai/' /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
sudo systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm
sudo systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm
Sync: true
Timeout: 3600
DependsOn:
- SecurityGroupIngress_80
Outputs:
ZabbixUrl:
Description:
zh-cn: Zabbix页面。
en: Zabbix Page.
Value:
'Fn::Sub':
- 'http://${IP}/zabbix'
- IP:
'Fn::Jq':
- First
- '.[0]'
- 'Fn::GetAtt':
- InstanceGroup
- PublicIps
Metadata:
'ALIYUN::ROS::Interface':
ParameterGroups:
- Parameters:
- ZoneId
- EcsInstanceType

0 comments on commit 7069593

Please sign in to comment.