顯示具有 Ubuntu 標籤的文章。 顯示所有文章
顯示具有 Ubuntu 標籤的文章。 顯示所有文章

2024/06/06

Graphite APT安裝心得

最近嘗試監控Proxmox VE Node所以花了一點時間去弄Graphite的安裝方式,結果Graphite官方文件的安裝說明簡略到不行。最終總算成功了。

安裝流程可以參考 https://luppeng.wordpress.com/2023/04/15/install-and-setup-graphite-on-ubuntu-server-22-04-via-apt-repository/ 的說明。

安裝環境

OS: Ubuntu 22.04

Web Server: Nginx

Python: 3.10


1. 系統更新到最新

apt update -y && apt upgrade -y


2. 安裝相關套件

apt install nano wget curl unzip -y

3. Graphite , Nginx, uWSGI安裝

apt install graphite-web graphite-carbon graphite-api nginx-full uwsgi uwsgi-plugins-all -y 

4. 設定Carbon-Cache

     這部份參照上方說明網站的Step 3即可

5. 建立Graphite Web的database

     這部份同樣參照說明網站的Step 5即可 

6. Graphite Web的設定檔

    這邊是參造說明網站的Step 6,可以用下面的指令產生SECRET_KEY

python3 -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())'

    免得啟用後會一直跳WARNING洗LOG,所以還是把KEY加上比較好。

    接著是依據Step 7做一個symbol link放到Graphie Web Python Application的實際位置

ln -s /etc/graphite/local_settings.py /usr/lib/python3/dist-packages/graphite/local_settings.py

  7. nginx的設定

      這邊直接參考 graphite官方的即可

2012/02/06

webmin及openwebmail安裝

以下都是透過yum方式安裝,rpm及tarball方式請自行google。
一、安裝webmin
        參考:http://webmin.com/rpm.html

Using the Webmin YUM repository

If you like to install and update Webmin via RPM, create the/etc/yum.repos.d/webmin.repo file containing :[Webmin]
name=Webmin Distribution Neutral
#baseurl=http://download.webmin.com/download/yum
mirrorlist=http://download.webmin.com/download/yum/mirrorlist
enabled=1
You should also fetch and install my GPG key with which the packages are signed, with the commands :wget http://www.webmin.com/jcameron-key.asc
rpm --import jcameron-key.asc
You will now be able to install with the command :yum install webminAll dependencies should be resolved automatically.


二、安裝openwebmail


How to install openwebmail from yum repository
==============================================
Thomas Chung <tchung@openwebmail.org>
2008.05.29
UPDATE 2010.05.24
Install perl-Text-Iconv from rpmforge for your arch if you're running RHEL or CentOS:
http://dag.wieers.com/rpm/packages/perl-Text-Iconv/
$ su -
# cd /etc/yum.repos.d
# lftpget http://openwebmail.org/openwebmail/download/redhat/rpm/release/openwebmail.repo
# yum install openwebmail
fedora 100% |=========================| 2.1 kB 00:00
openwebmail 100% |=========================| 951 B 00:00
updates 100% |=========================| 2.3 kB 00:00
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package openwebmail.i386 0:2.53-1 set to be updated
--> Processing Dependency: openwebmail-data = 2.53-1 for package: openwebmail
--> Processing Dependency: perl-suidperl for package: openwebmail
--> Processing Dependency: perl-Text-Iconv for package: openwebmail
--> Running transaction check
---> Package openwebmail-data.i386 0:2.53-1 set to be updated
---> Package perl-suidperl.i386 4:5.8.8-32.fc8 set to be updated
---> Package perl-Text-Iconv.i386 0:1.5-1.fc8 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing for dependencies:
openwebmail i386 2.53-1 openwebmail 2.3 M
openwebmail-data i386 2.53-1 openwebmail 7.0 M
perl-Text-Iconv i386 1.5-1.fc8 fedora 20 k
perl-suidperl i386 4:5.8.8-32.fc8 updates 60 k
Transaction Summary
=============================================================================
Install 4 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 9.4 M
Is this ok [y/N]: y
Downloading Packages:
(1/4): perl-Text-Iconv-1. 100% |=========================| 20 kB 00:00
(2/4): openwebmail-2.53-1 100% |=========================| 2.3 MB 00:03
(3/4): perl-suidperl-5.8. 100% |=========================| 60 kB 00:00
(4/4): openwebmail-data-2 100% |=========================| 7.0 MB 00:10
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID cfb164d8
Importing GPG key 0xCFB164D8 "Thomas Chung <tchung@openwebmail.org>" from http://openwebmail.org/.../RPM-GPG-KEY-openwebmail
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: perl-Text-Iconv ######################### [1/4]
Installing: perl-suidperl ######################### [2/4]
Installing: openwebmail ######################### [3/4]
Permission and Ownership for openwebmail files have been fixed!
Please execute following tool first as a root:
/var/www/cgi-bin/openwebmail/openwebmail-tool.pl --init
After restarting httpd service, login with non-root account from
http://localhost.localdomain/cgi-bin/openwebmail/openwebmail.pl
or http://localhost.localdomain/webmail
If SELinux enabled, you may need to set it 'permissive' in
/etc/sysconfig/selinux or system-config-selinux
Installing: openwebmail-data ######################### [4/4]
Dependency Installed: openwebmail.i386 0:2.53-1 openwebmail-data.i386 0:2.53-1 perl-Text-Iconv.i386 0:1.5-1.fc8 perl-suidperl.i386 4:5.8.8-32.fc8
Complete!
三、 openwebmail安裝好後的設定
        修改/var/log/openwebmail.log的 selinux設定
參考:http://j796160836.pixnet.net/blog/post/21882397-%5B%E7%AD%86%E8%A8%98%5D%5B%E6%A5%B5%E9%87%8D%E8%A6%81%5Dopenwebmail%E7%9A%84%E9%97%9C%E9%8D%B5%E8%A8%AD%E5%AE%9A%EF%BC%8C%E8%A8%AD%E5%AE%9Aselinu



2011/02/22

Nagios Plugin Check_SNMP

OS: CentOS 5.5
Nagios: nagios-3.2.3-3.el5.rf.i386
這篇是關於Nagios Plugin Check_SNMP中關於--rate指令的使用方式。
如果你是用YUM或是apt等方式安裝的Nagios,可能在使用check_snmp的--rate選項的時候會發生錯誤。
原因是因為check_snmp在儲存rate的狀態的時候,會除存在/var/check_snmp裡面,而extinfo.cgi確無法在開啟檔案,原因是目錄建立的時候,使用者及群組不是nagios(或你自訂的群組),權限也只有700。
所以將使用者及群組改成nagios(或你自訂的群組),權限也修改成755(或你覺得安全權限)。
裡面如果原本就有檔案的話,也請將使用者及群組改成nagios(或你自訂的群組),權限640即可。想省事一點可以把檔案全砍了,反正重新建立也不會有啥影響。之後重新啟動nagios就會正常。

2010/11/03

修改vim的編碼

vim ~/.vimrc 後 i 寫入 enc=utf-8 \n fenc=utf-8 :wq

2010/11/02

[Linux] 在 windows底下讀寫linux

« [Linux] cwRsync [rsync for windows] SSH 加密異地備份
Ubuntu Edgy Release KDE 桌面環境 »
[Linux] 在 windows底下讀寫linux

Dec 15th, 2006 by appleboy 參觀者:9,215Views 機器人:1,295Views
推到 Twitter!
推到 Plurk!
推到 Facebook!

剛剛在ptt看到的,一連串討論

□ XP 認得 ext2/ext3 磁區嗎 ?

裡面有很多文章 寫的不錯,可以提供出來

問題:

想問一下,我有一個移動式硬碟 60G
所以只能format 成 NTFS or ext2/ext3

而在 Linux 下, 目前支援 NTFS 讀寫可能要另外掛 package…

所以想問,那 Windows XP 是否支援 ext2 / ext3
ext3好像不行, 因為剛剛在 Linux 下 format成 ext3了
並備份了一些東東,到進到了Windows XP底下好像認不得了,

想問,ext2 在 Windows XP 底下,OK嗎…
xp認得嗎?

解法如下

作者 wyocbu@kkcity.com.tw (wyocbu),

以前下載過一個商業軟體 Paragon Mount Everything
http://www.mount-everything.com/

印象中好像可以讀寫 ext3

作者 ogre0403 (肚子餓)

只要讀的話 試試這個 應該是free的
http://www.chrysocome.net/explore2fs
寫的話應該不行

作者 alpe (薛丁格的貓)

http://www.fs-driver.org/

IFS Drivewrs 讀寫可… 不過中文編碼就…

作者 adolf.bbs@cd.twbbs.org (蘇怡華 有人要死了),

> http://ext2fsd.sf.net/
> ext2 可讀可寫
> ext3 唯讀

其實這類的driver都可以正常寫ext3
只是把journal關掉而已…

http://pank.org/blog/archives/000621.html


作者 jlovet (阿我真是猜不透XD)

ext2 跟 ext3是相容的檔案系統
在只支援ext2的OS上面mount ext3可以正常讀寫
只是會略過journal

關於ntfs-3g的測試…網站上面就有了…
http://www.ntfs-3g.org/performance.html

Ubuntu 掛載 Windows 分割區

Ubuntu 6.10 (Edgy):
deb http://givre.cabspace.com/ubuntu/ edgy main
deb http://ntfs-3g.sitesweetsite.info/ubuntu/ edgy main
deb http://flomertens.keo.in/ubuntu/ edgy main

Ubuntu 6.06 (Dapper Drake):
deb http://givre.cabspace.com/ubuntu/ dapper main main-all
deb http://ntfs-3g.sitesweetsite.info/ubuntu/ dapper main main-all
deb http://flomertens.keo.in/ubuntu/ dapper main main-all

然後執行以下指令更新 repositories 及安裝 ntfs-3g:

wget http://flomertens.keo.in/ubuntu/givre_key.asc -O- | sudo apt-key add -
wget http://givre.cabspace.com/ubuntu/givre_key.asc -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get install ntfs-3g

http://www.real-blog.com/linux-bsd-notes/290


文章來源

Ubuntu 9.10 增加 / 設定 語系(Locale)

Ubuntu 9.10 增加 / 設定 語系(Locale)

語系增加在 Debian / Ubuntu Linux 上, 都是編輯 /etc/locale.gen 此檔案, 再執行 locale-gen 即可.

在 Ubuntu Linux 9.10 後, /etc/locale.gen 這個檔案不見了, 設上去也沒有用, 於是來找找新的設定法.
Locales 設定

* 由 "man locale-gen" 可以找到新的設定位置: /var/lib/locales/supported.d/*
* cat /var/lib/locales/supported.d/local # 可以看到目前設定語系

zh_TW.UTF-8 UTF-8

Locales 增加

要增加語系可以有下述兩種做法: (註: 語系列表可見: /usr/share/i18n/SUPPORTED)

1. 手動加入語系
* vim /var/lib/locales/supported.d/zh # 隨意新增一個檔案(zh 這個檔名可隨意命名)

zh_CN.UTF-8 UTF-8
zh_SG.UTF-8 UTF-8
zh_HK.UTF-8 UTF-8
zh_TW.UTF-8 UTF-8

2. 使用 locale-gen 加入語系

1. sudo locale-gen zh_TW
2. sudo locale-gen zh_TW.UTF-8
3. cat /var/lib/locales/supported.d/local # 加入完成後, 可於此檔案看到資訊

重新建立 Locales

上述設定完成後, 執行重新建立的動作.

1. sudo locale-gen # 執行即可
2. 完成可見: ls /usr/lib/locale # 語系檔資料庫.

原始來源