TEMPer1의 온도 데이터 획득 플러그인 생성 방법
                                            
                                                
                                                
                                                
                                                
                                                
                                                 2267 단어  Munin
                    
USB 온도 센서 TEMPer1의 온도 데이터를 토대로 뮤언용 플러그인을 제작한다.
사전 요구 사항으로 USB 온도 센서 데이터
temper를 사전 명령디테일해야 합니다.또한 이 환경에서는 Pydora2014 R3(Fedora20과 같음)을 사용합니다.디테일
구조
출력 온도
temper 명령의 실행 결과는 시간 데이터와 온도 데이터로 2개의 데이터를 쉼표(,)로 구분한다.[root@pidora temper]# temper
06-Dec-2014 11:16,20.945581
cut 명령으로 성형 결과를 출력한다.[root@pidora temper]# /usr/bin/temper | cut -f2 -d','
21.009874
플러그인 설정
편집기를 사용하여
vi /etc/munin/plugins/temp 등을 통해 편집합니다.#!/bin/bash
if [ "$1" = "autoconf" ]; then
        echo yes
        exit 0
fi
if [ "$1" = "config" ]; then
        echo 'graph_title Room Temperature'
        echo 'graph_args --base 1000 -l 0'
        echo 'graph_vlabel Celsius'
        echo 'graph_scale no'
        echo 'graph_category RasPi'
        echo 'temp.label Room1'
        print_warning temp
        print_critical temp
        echo 'graph_info Room Temperature'
        echo 'temp.info /usr/bin/temper'
        # Last, if run with the "config"-parameter, quit here (don't
        # display any data)
        exit 0
fi
echo -n "temp.value "
/usr/bin/temper | cut -f2 -d','
# chmod 755 /etc/munin/plugins/temp
temper 명령은 루트 권한으로 실행되어야 합니다.따라서 실행할 때 사용자가 루트가 되는 방식으로 munin의 플러그인 설정을 파일로 한쪽에 두십시오.이걸 하지 않으면 퍼미션 데니드의 오류가 발생할 수 있어요.# cat << EOF > /etc/munin/plugin-conf.d/temp
[temp]
user root
EOF
munin-run 명령을 실행합니다.아래의 온도 정보를 표시할 수 있다면 문제없다.# /usr/sbin/munin-run temp
temp.value 20.945581
# systemctl restart munin-node
 
                Reference
이 문제에 관하여(TEMPer1의 온도 데이터 획득 플러그인 생성 방법), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/zembutsu/items/0f8e570c4016ddb4aefa텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)