리눅스 SUPERUSER

블로그 이미지

뱀고기*

nagios sms 설정 방법

Linux 2017. 9. 5. 16:42

기존에 메일로 나기오스 알림을 받는데 추가적으로 sms를 설정해야되는 일이 생겨 적용방법을 찾아보았는데


sms 서비스 이용시 대부분 db에 전화번호와 문자내용 밀어넣으면 알아서 발송되는 서비스를 이용하지만


이와관련한 문서가 없어서 야매로 설정하여 사용중..



일단은 첫번째로 db에 전화번호와 문자내용을 밀어넣을수 있는 소스 생성


소스에 민감한정보가 많아서 소스내용은 비공개



생성한 소스의 이름은 sms.php로 하였으며

소스 경로는 /usr/local/nagios/libexec 에 위치시킴



두번째로 nagios 의 commands.cfg 수정


# 'notify-service-by-email' command definition 부분의 설정내용 수정 전

define command{

  command_name  notify-service-by-email

  command_line  /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVI

CESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" 

$CONTACTEMAIL$

  }


# 'notify-service-by-email' command definition 부분 수정 후

define command{

  command_name  notify-service-by-email

  command_line  /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info

:\n\n$SERVICEOUTPUT$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$ && /usr/local/nagios/libexec/sms.php "휴대폰번호" $NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$

 is $SERVICESTATE$"

  }


빨간색 부분이 추가되는 부분이며 위 부분 엔터가 아니라 줄바꿈이니 이부분 유의해서 복사하여 사용합시다


전화번호가 여러개라면 저부분 추가로 또 붙인 후 폰번호 수정하여 쓰면됨

저작자표시 (새창열림)

'Linux' 카테고리의 다른 글

문서 내용들 찾아 바꾸기  (0) 2017.08.07
php 업그레이드  (0) 2017.06.19
bacula jobid 삭제 (How to find bacula jobid)  (0) 2017.03.08
oracle php 연동 설치(oci8.lo Error 1 해결)  (0) 2016.11.22
SVN 설치, 구성하기  (0) 2016.10.28
Posted by 뱀고기*

문서 내용들 찾아 바꾸기

Linux 2017. 8. 7. 10:47

바꿀 문서 존재하는 경로로 이동

perl -pi -e 's/찾을내용/바꿀내용/' *

저작자표시 (새창열림)

'Linux' 카테고리의 다른 글

nagios sms 설정 방법  (0) 2017.09.05
php 업그레이드  (0) 2017.06.19
bacula jobid 삭제 (How to find bacula jobid)  (0) 2017.03.08
oracle php 연동 설치(oci8.lo Error 1 해결)  (0) 2016.11.22
SVN 설치, 구성하기  (0) 2016.10.28
Posted by 뱀고기*

php 업그레이드

Linux 2017. 6. 19. 14:13

1. Verify current version of PHP

 

Type in the following to see the current PHP version:

 

php -v

 

Should output something like:

 

PHP 5.3.3 (cli) (built: Jul 9 2015 17:39:00) 
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

 

Great, now we can move on!

 

2. Install the Remi and EPEL RPM repositories

 

If you haven’t already done so, install the Remi and EPEL repositories

 

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm && rpm -Uvh epel-release-latest-6.noarch.rpm

 

wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm && rpm -Uvh remi-release-6*.rpm

 

Enable the REMI repository globally:

 

nano /etc/yum.repos.d/remi.repo

 

Under the section that looks like [remi] make the following changes:

 

[remi]
name=Remi's RPM repository for Enterprise Linux 6 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/6/remi/$basearch/
mirrorlist=http://rpms.remirepo.net/enterprise/6/remi/mirror
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

 

Also, under the section that looks like [remi-php55] make the following changes:

 

[remi-php56]
name=Remi's PHP 5.6 RPM repository for Enterprise Linux 6 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/6/php56/$basearch/
mirrorlist=http://rpms.remirepo.net/enterprise/6/php56/mirror
# WARNING: If you enable this repository, you must also enable "remi"
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

 

Type CTRL-O to save and CTRL-X to close the editor

 

3. Upgrade PHP 5.3 to PHP 5.6

 

Now we can upgrade PHP. Simply type in the following command:

 

yum -y upgrade php*

 

Once the update has completed, let’s verify that you have PHP 5.6 installed:

 

php -v

 

Should see output similar to the following:

 

PHP 5.6.14 (cli) (built: Sep 30 2015 14:07:43) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies


php -m 으로 확인후 memcache등 모듈 오류시*

memcache 재설치

tar xvzf memcache-2.2.7tgz

cd memcache-2.2.7

/usr/bin/phpize

./configure \

--with-php-config=/usr/bin/php-config


make


cp -arf modules/memcache.so /usr/lib64/php/modules


내경우 /etc/php.d include 하여 사용, 

cd /etc/php.d/

vi memcache.ini

; Enable curl extension module

extension=memcache.so

:wq


아파치 재시작



출처 : https://www.zerostopbits.com/how-to-upgrade-php-5-3-to-php-5-6-on-centos-6-7/ 

저작자표시 (새창열림)

'Linux' 카테고리의 다른 글

nagios sms 설정 방법  (0) 2017.09.05
문서 내용들 찾아 바꾸기  (0) 2017.08.07
bacula jobid 삭제 (How to find bacula jobid)  (0) 2017.03.08
oracle php 연동 설치(oci8.lo Error 1 해결)  (0) 2016.11.22
SVN 설치, 구성하기  (0) 2016.10.28
Posted by 뱀고기*
이전페이지 다음페이지
블로그 이미지

by 뱀고기*

공지사항

    최근...

  • 포스트
  • 댓글
  • 트랙백
  • 더 보기

태그

글 보관함

«   2025/05   »
일 월 화 수 목 금 토
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

링크

카테고리

분류 전체보기 (96)
Network (1)
Linux (55)
Mysql (17)
Apache (13)
SVN (2)
Cubrid (4)
Nginx (0)
AWS (2)

카운터

Total
Today
Yesterday
방명록 : 관리자 : 글쓰기
뱀고기*'s Blog is powered by daumkakao
Skin info material T Mark3 by 뭐하라
favicon

리눅스 SUPERUSER

  • 태그
  • 링크 추가
  • 방명록

관리자 메뉴

  • 관리자 모드
  • 글쓰기
  • 분류 전체보기 (96)
    • Network (1)
    • Linux (55)
    • Mysql (17)
    • Apache (13)
    • SVN (2)
    • Cubrid (4)
    • Nginx (0)
    • AWS (2)

카테고리

PC화면 보기 티스토리 Daum

티스토리툴바