1.概述

1.1.说明

本文细描述Linux环境下(arm架构x64)基于perl的msend.pl配置,以实现根据msend.pl进行告警事件的发送。

1.2.环境说明

OS Version:RHEL7.6(arm架构x64)

Perl Version: v5.16.3

1.3.msend.pl架构图

Linux msend.pl配置_msend

2.msend.pl配置

2.1.msend.pl配置

前提:以root用户进行配置,目录:/opt

1.上传msend.zip至/opt目录。

[root@rhel76 opt]# pwd

/opt

[root@rhel76 opt]# ls -l msend.zip

-rw-r--r-- 1 root root 413010 9月  13 10:22 msend.zip

[root@rhel76 opt]#

2.解压msend.zip至当前目录(/opt),并更改其属组(E.g: la_mdcs_adm)。 

命令:

unzip msend.zip

chown -R la_mdcs_adm:la_mdcs_adm msend/

[root@rhel76 opt]# unzip msend.zip

Archive:  msend.zip

   creating: msend/

   creating: msend/bin/

  inflating: msend/bin/msend.pl     

   creating: msend/etc/

   creating: msend/etc/locale/

  inflating: msend/etc/locale/arnotifymsg.properties 

  ……

  inflating: msend/etc/bak.mcell.dir 

  inflating: msend/etc/mcell.dir

[root@rhel76 opt]# chown -R la_mdcs_adm:la_mdcs_adm msend/

[root@rhel76 opt]# ls -l

总用量 404

drwxr-xr-x  4 la_mdcs_adm la_mdcs_adm     28 9月  13 10:11 msend

-rw-r--r--  1 root        root        413010 9月  13 10:22 msend.zip

[root@rhel76 opt]#

3.进入到其bin子目录(/opt/msend/bin),授权+x权限

命令:

cd msend/bin

chmod +x msend.pl

ls -l msend.pl

[root@rhel76 opt]# cd msend/bin/
[root@rhel76 bin]# pwd
/opt/msend/bin
[root@rhel76 bin]# chmod +x msend.pl 
[root@rhel76 bin]# ls -l msend.pl 
-rwxr-xr-x 1 la_mdcs_adm la_mdcs_adm 14409 5月  16 2011 msend.pl
[root@rhel76 bin]#

4.msend.pl帮助

命令:

su - la_mdcs_adm

/opt/msend/bin/msend.pl -h

[root@rhel76 ~]# /opt/msend/bin/msend.pl -h
BMC Impact 1.1 Perl Simple Sender (build: May 26th, 2003)
(c) Copyright 2003 BMC Software, All Rights Reserved

usage:

perl /opt/msend/bin/msend.pl [-a Class] [-f DirFile] [-h|-?] [-l HomeDir] [-n CellName[:cell2[:...]] | -n @Host[:Port]] [-q] [-v] [- | {SourceFile} | -a Class [-b SlotSetValue] [-m Message] [-o Source] [-r Severity]]

-a Send object of class Class
-b Add SlotSetValue settings (format: "slot=value;...")
-f Directory file path (default: <MCELL_HOME>/etc/mcell.dir)
-h Print this help and exit
-l Home directory (eg <MCELL_HOME>)
-m Send event message to Message
-n Connect to server CellName - as defined in directory
   or on indicated host and port
-o Send event source to Source
-q quiet execution (no banner)
-r Send event severity to Severity
-v Verbose
-z Print version number and exit
-  Input from standard input stream

[root@rhel76 ~]#

2.2.msend.pl告警发送验证

1.模拟告警

命令:

/opt/msend/bin/msend.pl -n @66.179.84.211:1828 -a EVENT -m "66.179.84.211 test event" -b "severity=CRITICLA"

[root@rhel76 ~]#/opt/msend/bin/msend.pl -n @66.179.84.211:1828 -a EVENT -m "66.179.84.211 test event" -b "severity=CRITICLA"
BMC Impact 1.1 Perl Simple Sender (build: May 26th, 2003)
(c) Copyright 2003 BMC Software, All Rights Reserved
[root@rhel76 ~]#

 2.Cell接收端告警接收验证

Linux msend.pl配置_msend_02