Cron <root@falcon21> /root/mrtg.sh  
-----------------------------------

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "ja_JP.eucJP"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

------------------------------------------

[root@falcon21 ~]# vi /root/mrtg.sh
#!/bin/bash

LOCK=/var/lock/mrtg/mrtg_l
CONFCACHE=/var/lib/mrtg/mrtg.ok

export LANG=ja_JP.eucJP
mrtg /etc/mrtg/mrtg.cfg --lock-file $LOCK --confcache-file $CONFCACHE


----------------
[root@falcon21 ~]# locale
LANG=ja_JP.UTF-8
LC_CTYPE="ja_JP.UTF-8"
LC_NUMERIC="ja_JP.UTF-8"
LC_TIME="ja_JP.UTF-8"
LC_COLLATE="ja_JP.UTF-8"
LC_MONETARY="ja_JP.UTF-8"
LC_MESSAGES="ja_JP.UTF-8"
LC_PAPER="ja_JP.UTF-8"
LC_NAME="ja_JP.UTF-8"
LC_ADDRESS="ja_JP.UTF-8"
LC_TELEPHONE="ja_JP.UTF-8"
LC_MEASUREMENT="ja_JP.UTF-8"
LC_IDENTIFICATION="ja_JP.UTF-8"
LC_ALL=

----------------
mrtg.sh 修正

[root@falcon21 ~]# vi /root/mrtg.sh
#!/bin/bash

LOCK=/var/lock/mrtg/mrtg_l
CONFCACHE=/var/lib/mrtg/mrtg.ok
LANG=ja_JP.UTF-8
LC_ALL=
LANG=ja_JP.eucJP
mrtg /etc/mrtg/mrtg.cfg --lock-file $LOCK --confcache-file $CONFCACHE
~
------------------------------------------
[root@falcon21 ~]# vi /root/mrtg.sh
[root@falcon21 ~]# chmod 755 mrtg.sh
[root@falcon21 ~]# ./mrtg.sh
[root@falcon21 ~]# ./mrtg.sh
[root@falcon21 ~]# ./mrtg.sh

投票数:0 平均点:0.00

 
Back to Top