首页 > 系统相关 >哪吒探针 - Windows 和Linux端agent安装(详细注意版)

哪吒探针 - Windows 和Linux端agent安装(详细注意版)

时间:2023-04-11 16:15:42浏览次数:54  
标签:Windows agent color important ui background Linux 0px border

一、Windows端agent安装配置

环境准备

  • 环境: Windows 服务器
  • 软件:哪吒探针点击下载、nssm 点击下载(探针agent和nssm都要下载准备好)
  1. 设置环境变量
    下载软件后,解压到任意位置,然后按 win+R 打开运行窗口,输入 sysdm.cpl 打开系统属性–>高级–>环境变量–>系统变量–>Path在最后把刚才的 nssm 目录加到最后。

注意: 和前面变量之间用半角; 分开。win10系统没有这个“;”

如图:

2.设置NSSM

以管理员身份运行 cmd(记住要是管理员,不然权限不够)

输入:nssm install <名字随便取,默认nezha>

nssm install nezha

弹出 UI,设置如下:

启动参数格式为:-s {Serverip}:{Port} -p {AgentKey} -d

注意:没有这个花括号{}。上面agent和nssm路径不要弄反。

自己对应修改,填写完毕后, 点击 install servce。记得nssm start nezha 启动。就可以在前端看到上线啦。
参数项来源:

一般NSSM命令:

1. 安装服务命令
nssm install <servicename>
nssm install <servicename> <program>
nssm install <servicename> <program> [<arguments>]
2. 删除服务
nssm remove
nssm remove <servicename>
nssm remove <servicename> confirm
3. 启动、停止服务
nssm start <servicename>
nssm stop <servicename>
nssm restart <servicename>
4. 查询服务状态
nssm status <servicename>
5. 服务控制命令
nssm pause <servicename>
nssm continue <servicename>
nssm rotate <servicename>

二、Linux端agent安装配置

环境准备

  • 环境: Linux系统 服务器
  • 软件:哪吒探针Linux点击下载(探针agent下载准备好解压放到/opt/nezha/agent文件夹目录下)

赋可执行权

chmod +x /opt/nezha/agent/nezha-agent

执行./nezha-agent 查看帮助

/opt/nezha/agent/nezha-agent -s 61.155.136.7:5555 -p 47505450286642c26d

这时候在web端就可以看到该Linux主机agent已连接监控端。

但是这个只是前台执行,退出后agent就会关闭,这个时候我们就需要使用system守护进程,或者使用nohup命令后台运行。

cd /etc/systemd/system/目录下新建守护进程文件

vi nezha-agent.service
[Unit]
Description=Nezha Agent
After=syslog.target
# Modify these two values and uncomment them if you have
#LimitNOFILE=65535
Type=simple
User=root
Group=root
WorkingDirectory=/opt/nezha/agent/
ExecStart=/opt/nezha/agent/nezha-agent -s 61.155.136.7:5555 -p 302e5e5cb34d511a53
Restart=always
#Environment=DEBUG=true

# Some distributions may not support these hardening directives. If you cannot start the service due
# to an unknown option, comment out the ones not supported by your version of systemd.
#ProtectSystem=full
#PrivateDevices=yes
#PrivateTmp=yes
#NoNewPrivileges=true

[Install]
WantedBy=multi-user.target

注意的是服务端的秘钥和ip地址不要和我这里一样,其他照复制即可。

三、默认主题CSS自定义

效果图

修改的CSS代码

<style>
/* 屏幕适配 */

@media only screen and (min-width: 1200px) {
  .ui.container {
    width: 77%;
  }
}

@media only screen and (max-width: 767px) {
  .ui.card>.content>.header:not(.ui), .ui.cards>.card>.content>.header:not(.ui) {
    margin-top: 0.4em;
  }
}



/* 图标颜色和大小*/

i.icon {
        color: #000;
/*下载图标间距*/
        width: 1em !important;
}



/* 菜单颜色 */

.ui.large.menu {
  border: 0;
  border-radius: 0px;
  background-color: rgba(255, 255, 255, 55%);
}

.ui.menu .active.item {
    background-color: transparent;    
}

.ui.dropdown .menu {
  border: 0;
  border-radius: 0px;
  background-color: rgba(255, 255, 255, 55%);
}



/* 登录按钮颜色 */

.nezha-primary-btn {
    background-color: #21ba45 !important;
    color: #fff;
}



/* 背景图片 */

body {
 content: " ";
  background: fixed;
  z-index: -1;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-position: top;
  background-repeat: no-repeat;
  background-size: cover;
  background-image: url(https://picture.mefj.com.cn/%E5%B4%96%E4%B8%8A%E7%9A%84%E6%B3%A2%E5%A6%9E4k%E9%AB%98%E6%B8%85%E5%A3%81%E7%BA%B8.jpg);
  font-family: Arial,Helvetica,sans-serif;
}



/* 大卡片 */

#app .ui.fluid.accordion {
    background-color: #fbfbfb26;
    border-radius: 0.6rem;
}



/* 小卡片 */

.ui.four.cards>.card {
    border-radius: 0.6rem;
    background-color: #fafafaa3;
}



/* 小卡片右上角图标颜色 */

.nezha-secondary-font {
  color: rgba(252, 166, 7, 0.952) !important;
}



/* 小卡片右上角图标位置 */

.ui.right.center.popup {
  margin: -3px 0 0 0.914286em !important;
  -webkit-transform-origin: left 50%;
  transform-origin: left 50%;
}
.ui.bottom.left.popup {
  margin-left: 1px !important;
  margin-top: 3px !important;
}
.ui.top.left.popup {
  margin-left: 0;
  margin-bottom: 10px !important;
}
.ui.top.right.popup {
  margin-right: 0;
  margin-bottom: 8px !important;
}
.ui.left.center.popup {
  margin: -3px .91428571em 0 0 !important;
  -webkit-transform-origin: right 50%;
  transform-origin: right 50%;
}



/* 小卡片布局 */

.status.cards .flag {
  margin-right: 0 !important;
}
.status.cards .header > .info.icon {
  float: right;
  margin-right: 0;
  cursor: pointer;
}
.status.cards .wide.column {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  height: 2.4rem !important;
}
.status.cards .three.wide.column {
  padding-right: 0 !important;
}
.status.cards .wide.column:nth-child(1) {
  margin-top: 1.2rem !important;
}
.status.cards .wide.column:nth-child(2) {
  margin-top: 1.2rem !important;
}
.status.cards .description {
  padding-bottom: 0.8rem !important;
}
.status.cards .ui.content.popup {
  min-width: 292px;
  min-width: 21rem;
}
.status.cards .outline.icon {
  margin-right: 4px;
}



/* 弹出来的卡片 */

.status.cards .ui.content.popup {
    line-height: 2rem;
    border-radius: 8px;
    border: 1px solid transparent;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    inset: 28.1562px auto auto 214.82px;
    background-color: #fafafaeb;
    -webkit-transition: all .3s ease;
    transition: all .3s ease;
    -webkit-box-shadow: 0 1px 4px 0 rgb(0 0 0 / 20%);
    box-shadow: 0 1px 4px 0 rgb(0 0 0 / 20%);
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    font-family: Arial,Helvetica,sans-serif;
}
.ui.content {
  margin: 0;
  padding: 1em !important;
}
.ui.top.popup:before {
    border-color: #fafafaeb transparent transparent;
}
.ui.popup:before {
    border-color: #fafafaeb transparent transparent;
}
.ui.bottom.left.popup:before {
    border-radius: 0px;
    border: 1px solid transparent;
    border-color: #fafafaeb transparent transparent;
    background: #fafafaeb;
    -webkit-box-shadow: 0px 0px 0 0 #fafafaeb;
    box-shadow: 0px 0px 0 0 #fafafaeb;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}
.ui.bottom.right.popup:before {
    border-radius: 0px;
    border: 1px solid transparent;
    border-color: #fafafaeb transparent transparent;
    background: #fafafaeb;
    -webkit-box-shadow: 0px 0px 0 0 #fafafaeb;
    box-shadow: 0px 0px 0 0 #fafafaeb;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}
.ui.top.left.popup:before {
    border-radius: 0px;
    border: 1px solid transparent;
    border-color: #fafafaeb transparent transparent;
    background: #fafafaeb;
    -webkit-box-shadow: 0px 0px 0 0 #fafafaeb;
    box-shadow: 0px 0px 0 0 #fafafaeb;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}
.ui.top.right.popup:before {
    border-radius: 0px;
    border: 1px solid transparent;
    border-color: #fafafaeb transparent transparent;
    background: #fafafaeb;
    -webkit-box-shadow: 0px 0px 0 0 #fafafaeb;
    box-shadow: 0px 0px 0 0 #fafafaeb;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}
.ui.left.center.popup:before {
    border-radius: 0px;
    border: 1px solid transparent;
    border-color: #fafafaeb transparent transparent;
    background: #fafafaeb;
    -webkit-box-shadow: 0px 0px 0 0 #fafafaeb;
    box-shadow: 0px 0px 0 0 #fafafaeb;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}



/* 进度条圆角和颜色 */

.ui.progress{border-radius:40rem}
.ui.progress .bar {
  min-width: 1.85em !important;
  border-radius: 15px;
/*进度条数字高度*/
  line-height: 1.65em;
  }

.ui.fine.progress> .bar {
  background-color: #21ba45!important;
}
.ui.progress> .bar {
  background-color: #000!important;
}
.ui.progress.fine .bar {
  background-color: #21ba45!important;
}
.ui.progress.warning .bar {
  background-color: #ff9800!important;
}
.ui.progress.error .bar {
  background-color: #e41e10!important;
}
.ui.progress.offline .bar {
  background-color: #000!important;
}



/* 上传下载图标颜色 */

i.arrow.alternate.circle.down.outline.icon {
    color: green;
}

i.arrow.alternate.circle.up.outline.icon {
    color: #ff0000;
}


/* 服务 */

.ui.table {
    background: RGB(225,225,225,0.6) !important;
}

.ui.table thead th {
    background: transparent !important;
}

.service-status .good {
    background-color: #21ba45 !important;
}

.service-status .danger {
  background-color: red !important;
}

.service-status .warning {
  background-color: orange !important;
}

/* 版权 */

.ui.inverted.segment, .ui.primary.inverted.segment {
    color: #000;
    font-weight: bold;
    background-color: #fafafaa3
}
</style>

<script>
window.onload = function(){
var avatar=document.querySelector(".item img")
var footer=document.querySelector("div.is-size-7")
footer.innerHTML="©2021 运维密码 & Powered by TLFang"

}
</script>

项目地址:https://github.com/naiba/nezha

参考来源

标签:Windows,agent,color,important,ui,background,Linux,0px,border
From: https://www.cnblogs.com/mefj/p/17306545.html

相关文章

  • python ssh Linux机器 paramiko库的简单使用
    pythonsshLinux机器paramiko库的简单使用以用户名密码方式连接Linux主机defconn_by_password():"""1)如果抛出异常:SSHException:Server'172.17.140.17'notfoundinknown_hosts则需要设置ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy(......
  • Linux 操作系统启动过程
    当接通电源,硬件通过一系列自检完成后,硬件把控制权转交给操作系统后Linux系统启动过程可以分为5个阶段:加载内核。运行init。系统初始化。建立终端。用户登录系统。init程序的类型:SysV: init,CentOS5之前,配置文件:/etc/inittab。Upstart: init,CentOS6,配置文......
  • Cacti监控远程linux机器配置(被监控端)
    一、被监控机安装snmpyum-yinstallsnmp二、被监控机的配置vi/etc/snmp/snmpd.conf做以下更改: 1、找到com2sec notConfigUser  default       public 改为:com2sec notConfigUser   192.168.1.1(改成监控服务器的ip)       public 2、找到access......
  • 使用Xshell远程连接Linux服务器
     https://blog.csdn.net/weixin_48016395/article/details/123190779?utm_medium=distribute.pc_relevant.none-task-blog-2~default~baidujs_baidulandingword~default-2-123190779-blog-129054565.235^v28^pc_relevant_default&spm=1001.2101.3001.4242.2&utm_rele......
  • Linux 04 文件操作
    文件查看$cat小文件$more小/大文件$head-n15filename开头$tail-n15filename结尾#tr转换命令,需要使用管道和通配符$catanaconda-ks.cfg|tr[a-z][A-Z]将文件中所有小写转换为大写$wc统计$wc-lanaconda-ks.cfg$wc-wanaconda-ks.cfg$wc-c......
  • Linux 上 定时备份 postgresql 数据库
    Linux上定时备份postgresql数据库为了避免操作数据库的风险因此计划每天对postgresql数据库进行定时备份1.服务器地址:备份服务器地址10.10.10.101(虚构)postgresql数据库所在的服务器地址10.10.10.100(虚构)因为我有单独的备份数据库不在同一个服务器上操作首先要保证这......
  • 快速把Nginx安装为Windows服务,把软件加入系统服务自动启动方法windows下
    用nssm软件下载地址:https://nssm.cc/download 首先介绍一个NSSM这个小工具,将exe做成系统服务,非常方便实用。官网:NSSM-theNon-SuckingServiceManager直接下载:nssm-2-24NSSM是一个服务封装程序,它可以将普通exe程序封装成服务,使之像windows服务一样运行。同类型的工具还......
  • 在Ubuntu系统上安装windows
    需要的工具:U盘 1.打开ubuntu启动盘制作工具,下载ubuntu镜像,制作启动器2.u盘启动,进入tryubuntu3.终端打开gparted  分割出一块合适大小的nfts区域用来装windows,如果直接用ubuntu的话由于本身的磁盘就在使用所以不能操作,只能在类似pe的系统里面操作4.制作windows启动盘......
  • Studio 3T 2023.3 (macOS, Linux, Windows) - MongoDB 的专业 GUI、IDE 和 客户端,现在
    TheprofessionalGUI,IDEandclientforMongoDB请访问原文链接:https://sysin.org/blog/studio-3t-2023/,查看最新版。原创作品,转载请保留出处。作者主页:sysin.orgStudio3T,MongoDB的专业GUI、IDE和客户端适用于MongoDB的所有IDE、客户端和GUI工具——在Atlas......
  • Jmeter在linux环境下会出现 html测试报告 响应结果为空得问题
    1.在jmeter_home/bin/jmeter.properties文件中修改配置jmeter.save.saveservice.response_data=truejmeter.save.saveservice.samplerData=true 2.在user.properties文件中追加配置jmeter.save.saveservice.output_format=xmljmeter.save.saveservice.response_data=truej......