# t_machine_script

name: sys_info
description: 获取系统信息
script:
  # 获取系统cpu信息\nfunction get_cpu_info() {\n  Physical_CPUs=$(grep "physical id" /proc/cpuinfo | sort | uniq | wc -l)\n  Virt_CPUs=$(grep "processor" /proc/cpuinfo | wc -l)\n  CPU_Kernels=$(grep "cores" /proc/cpuinfo | uniq | awk -F ': ' '{print $2}')\n  CPU_Type=$(grep "model name" /proc/cpuinfo | awk -F ': ' '{print $2}' | sort | uniq)\n  CPU_Arch=$(uname -m)\n  echo -e '\n-------------------------- CPU信息 --------------------------'\n  cat <<EOF | column -t\n物理CPU个数: $Physical_CPUs\n逻辑CPU个数: $Virt_CPUs\n每CPU核心数: $CPU_Kernels\nCPU型号: $CPU_Type\nCPU架构: $CPU_Arch\nEOF\n}\n\n# 获取系统信息\nfunction get_systatus_info() {\n  sys_os=$(uname -o)\n  sys_release=$(cat /etc/redhat-release)\n  sys_kernel=$(uname -r)\n  sys_hostname=$(hostname)\n  sys_selinux=$(getenforce)\n  sys_lang=$(echo $LANG)\n  sys_lastreboot=$(who -b | awk '{print $3,$4}')\n  echo -e '-------------------------- 系统信息 --------------------------'\n  cat <<EOF | column -t\n系统: ${sys_os}\n发行版本:   ${sys_release}\n系统内核:   ${sys_kernel}\n主机名:    ${sys_hostname}\nselinux状态:  ${sys_selinux}\n系统语言:   ${sys_lang}\n系统最后重启时间:   ${sys_lastreboot}\nEOF\n}\n\nget_systatus_info\n#echo -e "\n"\nget_cpu_info


name: get_process_by_name
params: [{"name": "进程名","model": "processName", "placeholder": "请输入进程名"}]
description: 获取进程运行状态
modifier: admin
update_time: 2021-07-12 15:33:41
script:
  #! /bin/bash\n# Function: 根据输入的程序的名字过滤出所对应的PID，并显示出详细信息，如果有几个PID，则全部显示\nNAME={{.processName}}\nN=`ps -aux | grep $NAME | grep -v grep | wc -l`    ##统计进程总数\nif [ $N -le 0 ];then\n  echo "无该进程！"\nfi\ni=1\nwhile [ $N -gt 0 ]\ndo\n  echo "进程PID: `ps -aux | grep $NAME | grep -v grep | awk 'NR=='$i'{print $0}'| awk '{print $2}'`"\n  echo "进程命令：`ps -aux | grep $NAME | grep -v grep | awk 'NR=='$i'{print $0}'| awk '{print $11}'`"\n  echo "进程所属用户: `ps -aux | grep $NAME | grep -v grep | awk 'NR=='$i'{print $0}'| awk '{print $1}'`"\n  echo "CPU占用率：`ps -aux | grep $NAME | grep -v grep | awk 'NR=='$i'{print $0}'| awk '{print $3}'`%"\n  echo "内存占用率：`ps -aux | grep $NAME | grep -v grep | awk 'NR=='$i'{print $0}'| awk '{print $4}'`%"\n  echo "进程开始运行的时刻：`ps -aux | grep $NAME | grep -v grep | awk 'NR=='$i'{print $0}'| awk '{print $9}'`"\n  echo "进程运行的时间：`  ps -aux | grep $NAME | grep -v grep | awk 'NR=='$i'{print $0}'| awk '{print $11}'`"\n  echo "进程状态：`ps -aux | grep $NAME | grep -v grep | awk 'NR=='$i'{print $0}'| awk '{print $8}'`"\n  echo "进程虚拟内存：`ps -aux | grep $NAME | grep -v grep | awk 'NR=='$i'{print $0}'| awk '{print $5}'`"\n  echo "进程共享内存：`ps -aux | grep $NAME | grep -v grep | awk 'NR=='$i'{print $0}'| awk '{print $6}'`"\n  echo "***************************************************************"\n  let N-- i++\ndone


name: sys_run_info
description: 获取cpu、内存等系统运行状态
update_time: 2021-04-25 15:07:16
script:
  #!/bin/bash\n# 获取要监控的本地服务器IP地址\nIP=`ifconfig | grep inet | grep -vE 'inet6|127.0.0.1' | awk '{print $2}'`\necho "IP地址："$IP\n \n# 获取cpu总核数\ncpu_num=`grep -c "model name" /proc/cpuinfo`\necho "cpu总核数："$cpu_num\n \n# 1、获取CPU利用率\n################################################\n#us 用户空间占用CPU百分比\n#sy 内核空间占用CPU百分比\n#ni 用户进程空间内改变过优先级的进程占用CPU百分比\n#id 空闲CPU百分比\n#wa 等待输入输出的CPU时间百分比\n#hi 硬件中断\n#si 软件中断\n#################################################\n# 获取用户空间占用CPU百分比\ncpu_user=`top -b -n 1 | grep Cpu | awk '{print $2}' | cut -f 1 -d "%"`\necho "用户空间占用CPU百分比："$cpu_user\n \n# 获取内核空间占用CPU百分比\ncpu_system=`top -b -n 1 | grep Cpu | awk '{print $4}' | cut -f 1 -d "%"`\necho "内核空间占用CPU百分比："$cpu_system\n \n# 获取空闲CPU百分比\ncpu_idle=`top -b -n 1 | grep Cpu | awk '{print $8}' | cut -f 1 -d "%"`\necho "空闲CPU百分比："$cpu_idle\n \n# 获取等待输入输出占CPU百分比\ncpu_iowait=`top -b -n 1 | grep Cpu | awk '{print $10}' | cut -f 1 -d "%"`\necho "等待输入输出占CPU百分比："$cpu_iowait\n \n#2、获取CPU上下文切换和中断次数\n# 获取CPU中断次数\ncpu_interrupt=`vmstat -n 1 1 | sed -n 3p | awk '{print $11}'`\necho "CPU中断次数："$cpu_interrupt\n \n# 获取CPU上下文切换次数\ncpu_context_switch=`vmstat -n 1 1 | sed -n 3p | awk '{print $12}'`\necho "CPU上下文切换次数："$cpu_context_switch\n \n#3、获取CPU负载信息\n# 获取CPU15分钟前到现在的负载平均值\ncpu_load_15min=`uptime | awk '{print $11}' | cut -f 1 -d ','`\necho "CPU 15分钟前到现在的负载平均值："$cpu_load_15min\n \n# 获取CPU5分钟前到现在的负载平均值\ncpu_load_5min=`uptime | awk '{print $10}' | cut -f 1 -d ','`\necho "CPU 5分钟前到现在的负载平均值："$cpu_load_5min\n \n# 获取CPU1分钟前到现在的负载平均值\ncpu_load_1min=`uptime | awk '{print $9}' | cut -f 1 -d ','`\necho "CPU 1分钟前到现在的负载平均值："$cpu_load_1min\n \n# 获取任务队列(就绪状态等待的进程数)\ncpu_task_length=`vmstat -n 1 1 | sed -n 3p | awk '{print $1}'`\necho "CPU任务队列长度："$cpu_task_length\n \n#4、获取内存信息\n# 获取物理内存总量\nmem_total=`free -h | grep Mem | awk '{print $2}'`\necho "物理内存总量："$mem_total\n \n# 获取操作系统已使用内存总量\nmem_sys_used=`free -h | grep Mem | awk '{print $3}'`\necho "已使用内存总量(操作系统)："$mem_sys_used\n \n# 获取操作系统未使用内存总量\nmem_sys_free=`free -h | grep Mem | awk '{print $4}'`\necho "剩余内存总量(操作系统)："$mem_sys_free\n \n# 获取应用程序已使用的内存总量\nmem_user_used=`free | sed -n 3p | awk '{print $3}'`\necho "已使用内存总量(应用程序)："$mem_user_used\n \n# 获取应用程序未使用内存总量\nmem_user_free=`free | sed -n 3p | awk '{print $4}'`\necho "剩余内存总量(应用程序)："$mem_user_free\n \n# 获取交换分区总大小\nmem_swap_total=`free | grep Swap | awk '{print $2}'`\necho "交换分区总大小："$mem_swap_total\n \n# 获取已使用交换分区大小\nmem_swap_used=`free | grep Swap | awk '{print $3}'`\necho "已使用交换分区大小："$mem_swap_used\n \n# 获取剩余交换分区大小\nmem_swap_free=`free | grep Swap | awk '{print $4}'`\necho "剩余交换分区大小："$mem_swap_free


# t_sys_config

name: system.sysconf.accountLoginConf
key: AccountLoginSecurity
remark: system.sysconf.accountLoginConfRemark
permission: all
create_time: 2023-06-17 11:02:11
creator: admin
update_time: 2023-06-17 14:18:07
modifier: admin
params:
  [{"name":"system.sysconf.useCaptcha","model":"useCaptcha","placeholder":"system.sysconf.useCaptchaPlaceholder","options":"true,false"},{"name":"system.sysconf.useOtp","model":"useOtp","placeholder":"system.sysconf.useOtpPlaceholder","options":"true,false"},{"name":"system.sysconf.otpIssuer","model":"otpIssuer","placeholder":""},{"name":"system.sysconf.loginFailCount","model":"loginFailCount","placeholder":"system.sysconf.loginFailCountPlaceholder"},{"name":"system.sysconf.loginFainMin","model":"loginFailMin","placeholder":"system.sysconf.loginFailMinPlaceholder"}]

value:
  {"useCaptcha":"true","useOtp":"false","loginFailCount":"5","loginFailMin":"10","otpIssuer":"mayfly-go"}


name: system.sysconf.oauth2LoginConf
key: Oauth2Login
remark: system.sysconf.oauth2LoginConfRemark
permission: admin,
create_time: 2023-07-22 13:58:51
creator: admin
update_time: 2023-07-22 19:34:37
modifier: admin
params:
  [{"name":"system.sysconf.oauth2Enable","model":"enable","placeholder":"system.sysconf.oauth2EnablePlaceholder","options":"true,false"},{"name":"system.sysconf.name","model":"name","placeholder":"system.sysconf.namePlaceholder"},{"name":"system.sysconf.clientId","model":"clientId","placeholder":"system.sysconf.clientIdPlaceholder"},{"name":"system.sysconf.clientSecret","model":"clientSecret","placeholder":"system.sysconf.clientSecretPlaceholder"},{"name":"system.sysconf.authorizationUrl","model":"authorizationURL","placeholder":"system.sysconf.authorizationUrlPlaceholder"},{"name":"system.sysconf.accessTokenUrl","model":"accessTokenURL","placeholder":"system.sysconf.accessTokenUrlPlaceholder"},{"name":"system.sysconf.redirectUrl","model":"redirectURL","placeholder":"system.sysconf.redirectUrlPlaceholder"},{"name":"system.sysconf.scope","model":"scopes","placeholder":"system.sysconf.scopePlaceholder"},{"name":"system.sysconf.resourceUrl","model":"resourceURL","placeholder":"system.sysconf.resourceUrlPlaceholder"},{"name":"system.sysconf.userId","model":"userIdentifier","placeholder":"system.sysconf.userIdPlaceholder"},{"name":"system.sysconf.autoRegister","model":"autoRegister","placeholder":"","options":"true,false"}]


name: system.sysconf.ldapLoginConf
key: LdapLogin
remark: system.sysconf.ldapLoginConfRemark
permission: admin,
create_time: 2023-08-25 21:47:20
creator: admin
update_time: 2023-08-25 22:56:07
modifier: admin
params:
  [{"name":"system.sysconf.ldapEnable","model":"enable","placeholder":"system.sysconf.dapEnablePlaceholder","options":"true,false"},{"name":"system.sysconf.host","model":"host","placeholder":"system.sysconf.host"},{"name":"system.sysconf.port","model":"port","placeholder":"system.sysconf.port"},{"name":"system.sysconf.bindDN","model":"bindDN","placeholder":"system.sysconf.bindDnPlaceholder"},{"name":"system.sysconf.bindPwd","model":"bindPwd","placeholder":"system.sysconf.bindPwdPlaceholder"},{"name":"system.sysconf.baseDN","model":"baseDN","placeholder":"system.sysconf.baseDnPlaceholder"},{"name":"system.sysconf.userFilter","model":"userFilter","placeholder":"system.sysconf.userFilerPlaceholder"},{"name":"system.sysconf.uidMap","model":"uidMap","placeholder":"system.sysconf.uidMapPlaceholder"},{"name":"system.sysconf.udnMap","model":"udnMap","placeholder":"system.sysconf.udnMapPlaceholder"},{"name":"system.sysconf.emailMap","model":"emailMap","placeholder":"system.sysconf.emailMapPlaceholder"},{"name":"system.sysconf.skipTlsVerfify","model":"skipTLSVerify","placeholder":"system.sysconf.skipTlsVerfifyPlaceholder","options":"true,false"},{"name":"system.sysconf.securityProtocol","model":"securityProtocol","placeholder":"system.sysconf.securityProtocolPlaceholder","options":"Null,StartTLS,LDAPS"}]


name: system.sysconf.systemConf
key: SysStyleConfig
remark: system.sysconf.systemConfRemark
permission: all
create_time: 2024-01-04 15:17:18
creator: admin
update_time: 2024-01-05 09:40:44
modifier: admin
params:
  [{"model":"logoIcon","name":"system.sysconf.logoIcon","placeholder":"system.sysconf.logoIconPlaceholder","required":false},{"model":"title","name":"system.sysconf.title","placeholder":"system.sysconf.titlePlaceholder","required":false},{"model":"viceTitle","name":"system.sysconf.viceTitle","placeholder":"system.sysconf.viceTitlePlaceholder","required":false},{"model":"useWatermark","name":"system.sysconf.useWatermark","placeholder":"system.sysconf.useWatermarkPlaceholder","options":"true,false","required":false},{"model":"watermarkContent","name":"system.sysconf.watermarkContent","placeholder":"system.sysconf.watermarkContentPlaceholder","required":false}]

value:
  {"title":"mayfly-go","viceTitle":"mayfly-go","logoIcon":"","useWatermark":"true","watermarkContent":""}


name: system.sysconf.machineConf
key: MachineConfig
remark: system.sysconf.machineConfRemark
permission: all
create_time: 2023-07-13 16:26:44
creator: admin
update_time: 2024-10-21 17:02:55
modifier: admin
params:
  [{"name":"system.sysconf.uploadMaxFileSize","model":"uploadMaxFileSize","placeholder":"system.sysconf.uploadMaxFileSizePlaceholder"},{"model":"termOpSaveDays","name":"system.sysconf.termOpSaveDays","placeholder":"system.sysconf.termOpSaveDaysPlaceholder"},{"model":"guacdHost","name":"system.sysconf.guacdHost","placeholder":"system.sysconf.guacdHostPlaceholder","required":false},{"name":"system.sysconf.guacdPort","model":"guacdPort","placeholder":"system.sysconf.guacdPortPlaceholder","required":false},{"model":"guacdFilePath","name":"system.sysconf.guacdFilePath","placeholder":"system.sysconf.guacdFilePathPlaceholder"}]

value:
  {"uploadMaxFileSize":"1000MB","termOpSaveDays":"30","guacdHost":"","guacdPort":"","guacdFilePath":"./guacd/rdp-file"}


name: system.sysconf.dbmsConf
key: DbmsConfig
value: {"querySqlSave":"false","maxResultSet":"0","sqlExecTl":"60"}
remark: system.sysconf.dbmsConfRemark
permission: admin,
create_time: 2024-03-06 13:30:51
creator: admin
update_time: 2024-03-06 14:07:16
modifier: admin
params:
  [{"model":"querySqlSave","name":"system.sysconf.recordQuerySql","placeholder":"system.sysconf.recordQuerySqlPlaceholder","options":"true,false"},{"model":"maxResultSet","name":"system.sysconf.maxResultSet","placeholder":"system.sysconf.maxResultSetPlaceholder","options":""},{"model":"sqlExecTl","name":"system.sysconf.sqlExecLimt","placeholder":"system.sysconf.sqlExecLimtPlaceholder"}]


name: system.sysconf.fileConf
key: FileConfig
value: {"basePath":"./file"}
remark: system.sysconf.fileConfRemark
permission: admin,
create_time: 2024-10-20 22:30:01
creator: admin
update_time: 2024-10-21 13:51:17
modifier: admin
params:
  [{"model":"basePath","name":"system.sysconf.basePath","placeholder":"system.sysconf.baesPathPlaceholder"}]


# t_sys_resource

ui_path: 12sSjal1/lskeiql1/
name: menu.machineList
code: machines
creator: admin
modifier: admin
create_time: 2021-05-25 16:50:04
update_time: 2024-11-07 11:30:53
meta:
  {"component":"ops/machine/MachineList","icon":"Monitor","isKeepAlive":true,"routeName":"MachineList"}


ui_path: Xlqig32x/UGxla231/
name: menu.menuPermission
code: resources
creator: admin
modifier: admin
create_time: 2021-05-26 15:23:07
update_time: 2024-11-07 14:03:31
meta:
  {"component":"system/resource/ResourceList","icon":"Menu","isKeepAlive":true,"routeName":"ResourceList"}


ui_path: Xlqig32x/sfslfel/
name: menu.account
code: accounts
creator: admin
modifier: admin
create_time: 2021-05-28 14:56:25
update_time: 2024-11-07 14:11:08
meta:
  {"component":"system/account/AccountList","icon":"Menu","isKeepAlive":true,"routeName":"AccountList"}


ui_path: sl3as23x/
name: menu.personalCenter
code: /personal
creator: admin
modifier: admin
create_time: 2021-06-03 14:25:35
update_time: 2024-11-06 20:55:37
meta:
  {"component":"personal/index","icon":"UserFilled","isHide":true,"isKeepAlive":true,"routeName":"Personal"}


ui_path: RedisXq4/Exitx4al/
name: menu.redisDataOp
code: data-operation
creator: admin
modifier: admin
create_time: 2021-07-19 20:17:29
update_time: 2024-11-07 13:58:03
meta:
  {"component":"ops/redis/DataOperation","icon":"iconfont icon-redis","isKeepAlive":true,"routeName":"DataOperation"}


ui_path: RedisXq4/Eoaljc12/
name: menu.redisManage
code: manage
creator: admin
modifier: admin
create_time: 2021-07-20 10:48:04
update_time: 2024-11-07 13:58:52
meta:
  {"component":"ops/redis/RedisList","icon":"iconfont icon-redis","isKeepAlive":true,"routeName":"RedisList"}


ui_path: Mongo452/eggago31/
name: menu.mongoDataOp
code: mongo-data-operation
creator: admin
modifier: admin
create_time: 2022-05-13 14:03:58
update_time: 2024-11-07 13:59:23
meta:
  {"component":"ops/mongo/MongoDataOp","icon":"iconfont icon-mongo","isKeepAlive":true,"routeName":"MongoDataOp"}


ui_path: Mongo452/ghxagl43/
name: menu.mongoManage
code: mongo-manage
creator: admin
modifier: admin
create_time: 2022-05-16 18:13:06
update_time: 2024-11-07 14:00:23
meta:
  {"component":"ops/mongo/MongoList","icon":"iconfont icon-mongo","isKeepAlive":true,"routeName":"MongoList"}


ui_path: Xlqig32x/Ulxaee23/
name: menu.sysConf
code: configs
creator: admin
modifier: admin
create_time: 2022-08-25 22:18:55
update_time: 2024-11-07 14:14:27
meta:
  {"component":"system/config/ConfigList","icon":"Setting","isKeepAlive":true,"routeName":"ConfigList"}


ui_path: Tag3fhad/glxajg23/
name: menu.tagTree
code: tag-trees
creator: admin
modifier: admin
create_time: 2022-10-24 15:19:40
update_time: 2024-11-07 09:46:57
meta:
  {"component":"ops/tag/TagTreeList","icon":"CollectionTag","isKeepAlive":true,"routeName":"TagTreeList"}


ui_path: 12sSjal1/W9XKiabq/
name: menu.machineCronJob
code: /machine/cron-job
creator: admin
modifier: admin
create_time: 2023-07-18 10:13:16
update_time: 2024-11-07 12:17:39
meta:
  {"component":"ops/machine/cronjob/CronJobList","icon":"AlarmClock","isKeepAlive":true,"routeName":"CronJobList"}


ui_path: 6egfEVYr/3r3hHEub/
name: menu.myTask
code: procinst-tasks
creator: admin
modifier: admin
create_time: 2024-02-27 22:55:35
update_time: 2024-11-07 14:01:39
meta:
  {"component":"flow/ProcinstTaskList","icon":"Tickets","isKeepAlive":true,"routeName":"ProcinstTaskList"}


ui_path: SmLcpu6c/
name: menu.dbTransfer
code: transfer
creator: liuzongyang
modifier: admin
create_time: 2024-02-29 16:17:50
update_time: 2024-11-07 13:47:44
meta:
  {"component":"ops/db/DbTransferList","icon":"Switch","isKeepAlive":true,"routeName":"DbTransferList"}


ui_path: 12sSjal1/UnWIUhW0/
name: menu.machineSecurityConfig
code: security
creator: admin
modifier: admin
create_time: 2024-04-23 20:37:22
update_time: 2024-11-07 12:18:13
meta:
  {"component":"ops/machine/security/SecurityConfList","icon":"Setting","isKeepAlive":true,"routeName":"SecurityConfList"}


