最新whmcs和服务器IPMI对接的相关资料收集

Z站站长今天给大家分享一个来自柴郡猫的资源,也是来自别的网站,希望大家喜欢,下载地址就在文中。

whmcs和服务器IPMI对接的相关资料收集

IPMI是我们独立服务器中常用的一种远程运维系统,可以远程进行开关机重启、重做系统等操作。

目前大部分商家都将IPMI和whmcs进行了对接,使用户登录账号后可以自行进行基础操作。

下面是收集的这些方面的资料,仅做备份,防止原资料博客删除。下面资料本人目前无法验证其可行性。大家有需求的话,谨慎操作。

更新:发一下whmcs的IPMI插件,本人未测试,自己测试是否可用,有能力就自己改下

https://down.cheshirex.com/%E7%BD%91%E7%AB%99%E6%BA%90%E7%A0%81/whmcs/Plugins/ipmi.zip

WHMCS的IPMI管理模块,WHMCS的IPMI管理插件,可以控制IPMI机器的开机关机重启

在WHMCS后台可以控制IPMI机器的电源项目…开/关 等.
要求WHMCS所在机器安装OpenIPMI组件
yum install OpenIPMI OpenIPMI-tools
而且PHP要允许EXEC这个危险函数(执行内部程序)
还要配置WHMCS产品..选择该模块功能
产品还要新增三个自定义区域,名称分别是ipmiip/ipmiuser/ipmipass 类型为文本框

<?php #save as [whmcs]/modules/servers/ipmi/ipmi.php   function ipmi_ClientArea($params) { # Output can be returned like this, or defined via a clientarea.tpl ipmi file (see docs for more info) $ipmiip = $params['customfields']["ipmiip"]; $ipmiuser = $params['customfields']["ipmiuser"]; $ipmipass = $params['customfields']["ipmipass"];  $cmd="ipmitool -H $ipmiip -U $ipmiuser -P $ipmipass -I lanplus power status"; $power=substr(exec($cmd),17); $p="https://$ipmiip/"; $code = "机器电源状态: $power 用户名:$ipmiuser 密码:$ipmipass <a href=/"$p/" target=/"_blank/" style=/"color:#cc0000/">登陆到IPMI页面</a>"; return $code; }  function ipmi_AdminLink($params) { $ipmiip = $params['customfields']["ipmiip"]; $ipmiuser = $params['customfields']["ipmiuser"]; $ipmipass = $params['customfields']["ipmipass"]; $i=explode(".",$ipmiip); $p="https://$ipmiip/" $code = "<a href=/"$p/" target=/"_blank/" style=/"color:#cc0000/">登陆到IPMI页面</a>"; return $code; }  function ipmi_LoginLink($params) { $ipmiip = $params['customfields']["ipmiip"]; $ipmiuser = $params['customfields']["ipmiuser"]; $ipmipass = $params['customfields']["ipmipass"]; $i=explode(".",$ipmiip); $p="https://$ipmiip/" $code = "<a href=/"$p/" target=/"_blank/" style=/"color:#cc0000/">登陆到IPMI页面</a>"; return $code; }  function ipmi_reboot($params) { $ipmiip = $params['customfields']["ipmiip"]; $ipmiuser = $params['customfields']["ipmiuser"]; $ipmipass = $params['customfields']["ipmipass"]; $cmd="ipmitool -H $ipmiip -U $ipmiuser -P $ipmipass -I lanplus power reset"; $return=exec($cmd); if ($return=="") $return = "success"; return $return; }  function ipmi_shutdown($params) { $ipmiip = $params['customfields']["ipmiip"]; $ipmiuser = $params['customfields']["ipmiuser"]; $ipmipass = $params['customfields']["ipmipass"]; $cmd="ipmitool -H $ipmiip -U $ipmiuser -P $ipmipass -I lanplus power off"; $return=exec($cmd); if ($return=="") $return = "success"; return $return; }  function ipmi_on($params) { $ipmiip = $params['customfields']["ipmiip"]; $ipmiuser = $params['customfields']["ipmiuser"]; $ipmipass = $params['customfields']["ipmipass"]; $cmd="ipmitool -H $ipmiip -U $ipmiuser -P $ipmipass -I lanplus power on"; $return=exec($cmd); if ($return=="") $return = "success"; return $return; }  function ipmi_cycle($params) { $ipmiip = $params['customfields']["ipmiip"]; $ipmiuser = $params['customfields']["ipmiuser"]; $ipmipass = $params['customfields']["ipmipass"]; $cmd="ipmitool -H $ipmiip -U user -P $pass -I lanplus power cycle"; $return=exec($cmd); if ($return=="") $return = "success"; return $return; }  function ipmi_ClientAreaCustomButtonArray() { $buttonarray = array( "重启RESET" => "reboot", "电源重置POWER_CYCLE" => "cycle", "电源关闭POWER_OFF" => "off", "电源开启POWER_ON" => "on", ); return $buttonarray; }  function ipmi_AdminCustomButtonArray() { $buttonarray = array( "重启RESET" => "reboot", "电源重置POWER_CYCLE" => "cycle", "电源关闭POWER_OFF" => "off", "电源开启POWER_ON" => "on", ); return $buttonarray; } ?>

Whmcs IPMI模块

yum install OpenIPMI OpenIPMI-tools

登陆whmcs后台》设置》产品/服务》相关产品》自定义字段》分别添加ipmiip/ipmiuser/ipmipass 类型为文本框的字段

下列代码保存路径modules/servers/ipmi/ipmi.php

<?php //save as [whmcs]/modules/servers/ipmi/ipmi.php function ipmi_ClientArea($params) { // Output can be returned like this, or defined via a clientarea.tpl ipmi file (see docs for more info) $ipmiip = $params[‘customfields’][“ipmiip”]; $ipmiuser = $params[‘customfields’][“ipmiuser”]; $ipmipass = $params[‘customfields’][“ipmipass”]; $cmd=”ipmitool -H $ipmiip -U $ipmiuser -P $ipmipass -I lanplus power status”; $power=substr(exec($cmd),17); $p=”https://$ipmiip/”; $code = “机器电源状态: $power  用户名:$ipmiuser 密码:$ipmipass <a href=/”$p/” target=/”_blank/” style=/”color:#cc0000/”>登陆到IPMI页面</a>”; return $code; } function ipmi_AdminLink($params) { $ipmiip = $params[‘customfields’][“ipmiip”]; $ipmiuser = $params[‘customfields’][“ipmiuser”]; $ipmipass = $params[‘customfields’][“ipmipass”]; $i=explode(“.”,$ipmiip); $p=”https://$ipmiip/”; $code = “<a href=/”$p/” target=/”_blank/” style=/”color:#cc0000/”>登陆到IPMI页面</a>”; return $code; } function ipmi_reboot($params) { $ipmiip = $params[‘customfields’][“ipmiip”]; $ipmiuser = $params[‘customfields’][“ipmiuser”]; $ipmipass = $params[‘customfields’][“ipmipass”]; $cmd=”ipmitool -H $ipmiip -U $ipmiuser -P $ipmipass -I lanplus power reset”; $return=exec($cmd); if ($return==””) $return = “success”; return $return; } function ipmi_off($params) { $ipmiip = $params[‘customfields’][“ipmiip”]; $ipmiuser = $params[‘customfields’][“ipmiuser”]; $ipmipass = $params[‘customfields’][“ipmipass”]; $cmd=”ipmitool -H $ipmiip -U $ipmiuser -P $ipmipass -I lanplus power off”; $return=exec($cmd); if ($return==””) $return = “success”; return $return; } function ipmi_on($params) { $ipmiip = $params[‘customfields’][“ipmiip”]; $ipmiuser = $params[‘customfields’][“ipmiuser”]; $ipmipass = $params[‘customfields’][“ipmipass”]; $cmd=”ipmitool -H $ipmiip -U $ipmiuser -P $ipmipass -I lanplus power on”; $return=exec($cmd); if ($return==””) $return = “success”; return $return; } function ipmi_cycle($params) { $ipmiip = $params[‘customfields’][“ipmiip”]; $ipmiuser = $params[‘customfields’][“ipmiuser”]; $ipmipass = $params[‘customfields’][“ipmipass”]; $cmd=”ipmitool -H $ipmiip -U user -P $pass -I lanplus power cycle”; $return=exec($cmd); if ($return==””) $return = “success”; return $return; } function ipmi_ClientAreaCustomButtonArray() { $buttonarray = array( “重启RESET” => “reboot”, “电源重置POWER_CYCLE” => “cycle”, “电源关闭POWER_OFF” => “off”, “电源开启POWER_ON” => “on”, ); return $buttonarray; } function ipmi_AdminCustomButtonArray() { $buttonarray = array( “重启RESET” => “reboot”, “电源重置POWER_CYCLE” => “cycle”, “电源关闭POWER_OFF” => “off”, “电源开启POWER_ON” => “on”, ); return $buttonarray; } ?>

 

NOC-PS

除了上面两个之外,还有很多机房使用“NOC-PS”

NOC-PS官网:https://www.noc-ps.com/

英文PDF资料:https://down.cheshirex.com/%E6%96%87%E6%A1%A3%E7%B1%BB/NOCPS-Manual-EN.pdf

注意事项
1.必须先购买授权,授权与体验功能完全有差别;
2.IPMI必须开启 IPMI over LAN is enabled;

大家觉得Z站站长分享得这个资源怎么样?赶紧评论一下吧!

【小程序源码网资源版权风险说明】:
本站为避免不必要的纷争,分享的所有资源中一切可能有版权风险的资源将全部转载自第三方网站或平台,站长只为大家提供相关资源的介绍和跳转引导。 因可能有疏忽大意,所以如有遗漏资源侵犯了您的合法权利,请联系站长删除。
【小程序源码网资源下载使用说明】:
本站所分享的一切QQ小程序源码,thinkphp整站源码,微信小程序源码,图文教程等资源仅供用户学习参考使用,任何人不得作其他用途,违者自行承担所有责任。
【小程序源码网毫无人看的介绍】:
本站又称Z站,原名贼娘网,开站于2018年,换过三任站长,目前站长是第四任站长,本站是一个主要分享免费开源小程序源码/网站源码/免费素材/教程资源的网站,主要小程序资源有用于学习的小程序源码,也有正版原创可商用的小程序源码,是一个公益博客型网站。
【小程序源码网原创源码版权申明】:
未经小程序源码网许可,任何人不得擅自使用本站原创首发源码进行商业行为(除本站VIP用户在期限内,版权无使用限制),否则将依法承担相应赔偿责任。
【小程序源码网转载文章版权申明】:
本站所转载的QQ小程序或微信小程序源码与其他资源仅供学习,任何人不得作其他用途,违者自行承担所有责任。
【小程序源码网站长最后的屁话】:
如有您认为本站有任何侵犯您合法权益的文章,或者您有什么疑问需求,欢迎联系站长QQ,站长24小时在线,备注公司名称和源码版权问题或者需要小程序定制开发等站长业务类型可急速处理,如果您只是交流小程序的一些开发问题或源码问题可以加入QQ群讨论,就不用加站长啦,对于白嫖党,QQ群才是处理问题的天堂,当然站长也欢迎大家骚扰~
小程序源码网 » 最新whmcs和服务器IPMI对接的相关资料收集

发表评论

嘿,投喂下嘛!