从CMDB查询云平台组件或者IP简单脚本
#!/bin/bash
#author xiaoweige
#todo: ip -- > ingredient or ingredient -- > ip
#todo: get the ip of the given ingredient
function ingredient_ip() {
#todo: get the ip of the ingredient given
mysql -uroot -pengine -e "select * from ipandingredient.ipandingredient where env ='$1' and ingredient='$2'"
}
#todo: not sure what the ingredient is
function search_ingredient() {
mysql -uroot -pengine -e "use ipandingredient ;select * from ipandingredient where ingredient like '%${1}%' "
}
#todo: get the ip of the ingredient given
function ip_ingredient() {
mysql -uroot -pengine -e "use ipandingredient; select * from ipandingredient where env='$1' and ip='$2' "
}
function usage() {
echo "to get ingredient USAGE: ./$0 ip"
echo "to get ip USAGE: ./$0 ingredient"
echo "search ingredient ./$0 sth"
}
function main(){
if [ $# -eq 0 ]
then
usage
elif [ $# -eq 1 ]
then
search_ingredient $1
elif [ $# -eq 2 ]
then
argtype=`echo $2|egrep [1-9+\.]`
if [ -z $argtype ]
then
ingredient_ip $1 $2
else
ip_ingredient_ip $1 $2
fi
fi
}
main $*
从CMDB查询云平台组件或者IP简单脚本的更多相关文章
- 云平台服务运行情况检测脚本V0.1
1.准备Python3环境 yum groupinstall "Development tools" -y yum install zlib-devel bzip2-devel o ...
- 基于容器微服务的PaaS云平台设计(一) 实现容器微服务和持续集成
版权声明:本文为博主原创文章,欢迎转载,转载请注明作者.原文超链接 ,博主地址:http://www.cnblogs.com/SuperXJ/ 前言:关于什么是容器微服务PaaS和容器微服务PaaS的 ...
- 完整部署CentOS7.2+OpenStack+kvm 云平台环境(3)--为虚拟机指定固定ip
之前在测试环境(centos7.2)上部署了openstack云平台(完整部署CentOS7.2+OpenStack+kvm 云平台环境(1)--基础环境搭建),openstack在neutron组网 ...
- YY游戏私有云平台实践 (转自InfoQ )
作者 风河 发布于 2016年1月13日 | 讨论 编者按:YY游戏的页游早在2013年就在云平台上运行,其Cloud 1.0已经支撑几十万的同时在线用户.日前,YY游戏云平台进行了Cloud 2 ...
- OpenStack-Ocata版+CentOS7.6 云平台环境搭建 — 8.仪表盘 Dashboard(horizon)安装配置
仪表盘Dashboard(horizon)是一个web接口,使得云平台管理员以及用户可以管理不同的Openstack资源以及服务.这个部署示例使用的是 Apache Web 服务器. 节点配置信息说明 ...
- 完整部署CentOS7.2+OpenStack+kvm 云平台环境(2)--云硬盘等后续配置
继上一篇博客介绍了完整部署CentOS7.2+OpenStack+kvm 云平台环境(1)--基础环境搭建,本篇继续讲述后续部分的内容 1 虚拟机相关1.1 虚拟机位置介绍 openstack上创建的 ...
- 使用 Azure CLI 在 Azure China Cloud 云平台上手动部署一套 Cloud Foundry
这篇文章将介绍如何使用 Azure CLI 在 Azure China Cloud 云平台上手动部署一套 Cloud Foundry.本文的目的在于: 了解作为 PaaS 的 Cloud Foundr ...
- Kubernetes容器云平台建设实践
[51CTO.com原创稿件]Kubernetes是Google开源的一个容器编排引擎,它支持自动化部署.大规模可伸缩.应用容器化管理.伴随着云原生技术的迅速崛起,如今Kubernetes 事实上已经 ...
- 轻量化安装 TKEStack:让已有 K8s 集群拥有企业级容器云平台的能力
关于我们 更多关于云原生的案例和知识,可关注同名[腾讯云原生]公众号~ 福利: ①公众号后台回复[手册],可获得<腾讯云原生路线图手册>&<腾讯云原生最佳实践>~ ②公 ...
随机推荐
- [转]vue数据绑定(数据,样式,事件)
1.mounted 与 methods 与 computed 与 watched区别 From:https://blog.csdn.net/qinlulucsdn/article/details/80 ...
- Vue 页面15分钟无操作时返回首页
这种需求手机端和pc端一般是不存在的,因为都是可以手动操作刷新的. 最近在做一个户外社区大屏的项目,因为大屏是全屏显示,没法手动刷新,不可能在页面专门做一个刷新按钮,也不好看,那这样的需求就显得格外重 ...
- C# 获取客户端信息 /asp.net/WebService/WebForm
Request.Browser.MajorVersion.ToString();//获取客户端浏览器的(主)版本号Request.Browser.Version.ToString(); //获取客 ...
- LeetCode 536----Construct Binary Tree from String
536. Construct Binary Tree from String You need to construct a binary tree from a string consisting ...
- git报错:Pull is not possible because you have unmerged files解决方法
在git pull的过程中,如果有冲突,那么除了冲突的文件之外,其它的文件都会做为staged区的文件保存起来. 重现: $ git pull A Applications/Commerce/B ...
- node(3)MVC代码结构模式moogoDB的学习
---恢复内容开始--- 一.MVC代码结构模式 设计模式:观察者模式.中介者模式,这种模式,主要做的事情是处理类与类之间‘高内聚.低耦合’; 代码架构模式:MVC.MVVM.MVP Model:模型 ...
- node (1)
一.介绍 Node.js是一个让JavaScript运行在服务器端的开发平台,它让JavaScript的触角伸到了服务器端. 但Node似乎有点不同: ● Node.js不是一种独立的语言,与PHP. ...
- 【Python】Java程序员学习Python(一)— 为什么学习Python
现在是6月份,毕业快3年了,虽然不能说对Java掌握的程度达到了如火纯青的地步,但是依然感觉到了瓶颈期,Java用的多了,也到了随心所欲的地步了,所以学第二门语言的想法一直在我脑海里闪现,有想法了就要 ...
- eclipse打成可运行jar包,清空运行路径选项
到eclipse的工作空间找到/.metadata/.plugins/org.eclipse.debug.core/.launches文件夹,清空:然后重启eclipse即可:
- 回归JavaScript基础(一)
主题:JavaScript简介. 一.JavaScript的起源 JavaScript诞生于1995年.当时,它的主要作用是处理一些输入验证操作.之前的话,都是把表单数据发送到服务器端,然后再去判断有 ...