• 配置环境说明

192.168.3.80-XSCF地址
192.168.2.80-solaris操作系统IP地址 (nagios客户端)
192.168.2.120-nagios服务器端
check_xscf.pl-检查xscf的执行脚本,放在nagios客户端上。
check_xscf.cfg-检查xscf的配置文件,主要用于设置温度和电压的阈值,放在nagios客户端上。
脚本下载地址:http://exchange.nagios.org/directory/Plugins/Uncategorized/Plugin-to-check-Sun%27s-XSCF-%28local-service%29/details脚本执行方式:nagios服务器端通过check_nrpe调用nagios客户端上的check_xscf.pl脚本来执行xscf命令。
  • 在nagios客户端上为用户nagios生成rsa key

以root登录nagios客户端: 192.168.2.80
-bash-3.00# grep nagios /etc/shadow
nagios:*LK*:::::::
-bash-3.00# su - nagios
Sun Microsystems Inc. SunOS 5.10 Generic January 2005 为nagios用户产生ssh rsa key:
$ /usr/bin/ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/usr/local/nagios/.ssh/id_rsa):
Created directory '/usr/local/nagios/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /usr/local/nagios/.ssh/id_rsa.
Your public key has been saved in /usr/local/nagios/.ssh/id_rsa.pub.
The key fingerprint is:
69:d5:16:3a:e7:0d:0d:df:fe:26:96:08:f3:a4:55:f3 nagios@acs00mlcprc01
$ cd /usr/local/nagios/.ssh
$ ls
id_rsa id_rsa.pub
$ more id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAvryQqyhFPzcXzSJiIM9JWm0jl3igF8MgJQAUMZCj6YTa
jXNMZOfrjY/OO0gjmGyz/t+I4EJDsVw4g8bvbYvsolp7acE6eJ43wCQ+5Gx/rjqxwE7LYnwGBPxDLtuS
XIjwwwroLbjNMe0cbYjmA04HHnX58yu+Ne+TOvcqttXzVN0= nagios@acs00mlcprc01
以上是rsa public key的内容。
  • 登录XSCF,增加ssh用户public key

XSCF> showssh -c pubkey
XSCF> setssh -c addpubkey -u mlc
Please input a public key:
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAvryQqyhFPzcXzSJiIM9JWm0jl3igF8MgJQAUMZCj6YTa
jXNMZOfrjY/OO0gjmGyz/t+I4EJDsVw4g8bvbYvsolp7acE6eJ43wCQ+5Gx/rjqxwE7LYnwGBPxDLtuS
XIjwwwroLbjNMe0cbYjmA04HHnX58yu+Ne+TOvcqttXzVN0= nagios@acs00mlcprc01
XSCF> showssh -c pubkey
Public key:
1 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAvryQqyhFPzcXzSJiIM9JWm0jl3igF8MgJQAUMZCj6YTajXNMZOfrjY/OO0gjmGyz/t+I4EJDsVw4g8bvbYvsolp7acE6eJ43wCQ+5Gx/rjqxwE7LYnwGBPxDLtuSXIjwwwroLbjNMe0cbYjmA04HHnX58yu+Ne+TOvcqttXzVN0= nagios@acs00mlcprc01
XSCF> exit
  • 测试用户SSH public key方式进行身份验证

测试用户nagios是否能够通过identity_file在XSCF上执行命令 (192.168.2.80)
$ ssh -l mlc -i /usr/local/nagios/.ssh/id_rsa 192.168.3.80 showdomainstatus -a
The authenticity of host '192.168.3.80 (192.168.3.80)' can't be established.
RSA key fingerprint is d1:83:1b:b7:eb:f3:70:f2:b8:f5:e2:43:5c:af:a1:e9.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.3.80' (RSA) to the list of known hosts.
DID Domain Status
00 Running
01 -
02 -
03 -
$ more /usr/local/nagios/.ssh/known_hosts
192.168.3.80 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAyRYZFTYrKzK/XYSnxUe8lvTEErvy2LV6F
0vIBjiwUwEKYh8KIFTeUdkiJbt4yn0UkjN3UDP16Ao8n53xRKRXqXlkWFmrqeY4NCY5ahG4FFayNBWVJ
0MVrL9wRak1d6il9XEv8iN3k3xayb8O22S/SID238/TbDYj9YebIkpLVpc=
第一次执行时先把xscf的地址加入到known_hosts里。 $ ssh -l mlc -i /usr/local/nagios/.ssh/id_rsa 192.168.3.80 showdomainstatus -a
DID Domain Status
00 Running
01 -
02 -
03 -
第二次执行时直接就输出命令执行结果了。
  • 配置nagios客户端

把检查脚本check_xscf.pl和配置文件check_xscf.cfg拷贝到nagios客户端192.168.2.80的/usr/local/nagios/libexec目录下,并为check_xscf.pl文件增加执行权限
-bash-3.00# chmod a+x /usr/local/nagios/libexec/check_xscf.pl 在nagios客户端的/usr/local/nagios/etc/nrpe.cfg中增加:
command[check_xscf_hw]=/usr/local/nagios/libexec/check_xscf.pl -n 192.168.3.80 -u mlc -i /usr/local/nagios/.ssh/id_rsa -c showhardconf
command[check_xscf_ev]=/usr/local/nagios/libexec/check_xscf.pl -n 192.168.3.80 -u mlc -i /usr/local/nagios/.ssh/id_rsa -c showenvironment /usr/local/nagios/libexec
/check_xscf.cfg使用nagios试运行新加的两个检查 使用nagios用户试运行新加的两个检查项:
-bash-3.00# su - nagios
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
$ /usr/local/nagios/libexec/check_xscf.pl -n 192.168.3.80 -u mlc -i /usr/local/nagios/.ssh/id_rsa -c showhardconf
Hardware OK ! |
$ /usr/local/nagios/libexec/check_xscf.pl -n 192.168.3.80 -u mlc -i /usr/local/nagios/.ssh/id_rsa -c showenvironment /usr/local/nagios/libexec/check_xscf.cfg
Environment OK ! |100C, 70C, 1.1*U, 0.9*U,
  • 在nagios服务器端增加相应check_nrpe的配置即可。

如何配置nagios监控SUN(富士通)MX000系列服务器的XSCF的更多相关文章

  1. Nagios监控的部署与配置

    [安装Nagios] yum install -y httpd httpd-devel httpd-tools mysql mysql-devel mysql-server php php-devel ...

  2. 烂泥:nagios监控单网卡双IP

    本文由秀依林枫提供友情赞助,首发于烂泥行天下. 公司的业务有几台服务器存放在IDC机房中,说是双线路.但是我看到网卡的配置是单网卡双IP的形式.如下: 而公司这边的线路是联通的IP,如下: nagio ...

  3. Nagios监控系统部署(源码)

    1. 概述2. 部署Nagios2.1 创建Nagios用户组2.2 下载Nagios和Nagios-plugin源码2.3 编译安装3. 部署Nagios-plugin3.1 编译安装nagios- ...

  4. Nagios监控系统部署(源码)(四)

    Nagios监控系统部署(源码)   1. 概述2. 部署Nagios2.1 创建Nagios用户组2.2 下载Nagios和Nagios-plugin源码2.3 编译安装3. 部署Nagios-pl ...

  5. CentOS 7.4 下安装部署Nagios监控系统详细攻略(三)

    Nagios是一个流行的电脑系统和网络监控程序,它检测主机和服务,当异常发生和解除时能提醒用户.它是基于GPLv2开发的开源软件,可免费获得及使用. nagios工作原理 nagios的功能是监控服务 ...

  6. Nagios学习实践系列——配置研究[监控当前服务器]

    其实上篇Nagios学习实践系列——基本安装篇只是安装了Nagios基本组件,虽然能够打开主页,但是如果不配置相关配置文件文件,那么左边菜单很多页面都打不开,相当于只是一个空壳子.接下来,我们来学习研 ...

  7. Nagios+pnp4nagios+rrdtool 安装配置nagios被监控端NRPE配置(二)

    NRPE监控插件基础 NRPE总共由两部分组成: (1).check_nrpe插件,运行在监控主机上. (2).NRPE daemon,运行在远程的linux主机上(通常就是被监控机) 整个的监控过程 ...

  8. (转)Nagios 配置及监控

    Nagios 配置及监控 原文:http://blog.csdn.net/linuxlsq/article/details/52606824 Nagios 监控 在互联网日益发展的今天,监控的重要性已 ...

  9. SpringBoot系列之集成Druid配置数据源监控

    SpringBoot系列之集成Druid配置数据源监控 继上一篇博客SpringBoot系列之JDBC数据访问之后,本博客再介绍数据库连接池框架Druid的使用 实验环境准备: Maven Intel ...

随机推荐

  1. openstack-ansible Chapter 4. Deployment configuration

    Initial environment configuration Copy the contents of the /opt/openstack-ansible/etc/openstack_depl ...

  2. SQL Server 性能优化之RML Utilities:快速入门(Quick Start)(1)

      SQL Server 性能优化之RML Utilities:快速入门(Quick Start)(1) 安装Quick Start工具 RML(Replay Markup Language)是MS ...

  3. sql print

    这个因为你使用了varchar+int ,但是print只支持一种类型的输出,你要么通过转换函数将@no转换成字符类型,要么去掉@name.print '李勇' + convert(varchar, ...

  4. nginx默认语法

    vi /etc/nginx/nginx.conf user 设置nginx服务的系统使用用户worker_processes 工作进程数error_log nginx的错误日志pid nginx服务启 ...

  5. MySQL 各种引擎

    数据库中的存储引擎其实是对使用了InnoDB.HEAP(也称为MEMORY).CSV.BLACKHOLE(黑洞引擎).ARCHIVE.PERFORMANCE_SCHEMA. Berkeley.Merg ...

  6. @angular/cli项目构建--interceptor

    JWTInterceptor import {Injectable} from '@angular/core'; import {HttpEvent, HttpHandler, HttpInterce ...

  7. hdu--1878--欧拉回路(并查集判断连通,欧拉回路模板题)

     题目链接 /* 模板题-------判断欧拉回路 欧拉路径,无向图 1判断是否为连通图, 2判断奇点的个数为0 */ #include <iostream> #include <c ...

  8. CATransform3D 矩阵变换之立方体旋转实现细节 (转)

    原文地址 http://blog.csdn.net/ch_soft/article/details/7351896 第一部分.前几天做动画,使用到了CATransform3D ,由于没有学过计算机图形 ...

  9. 简单常用sql查询

    [self.db executeUpdate:sql, record.recordID]; CREATE TABLE scene_record(id TEXT PRIMARY KEY, record_ ...

  10. Busybox shell脚本修改密码

    /****************************************************************************** * Busybox shell脚本修改密 ...