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

2017/02/11

今天朋友介紹graylog
稍微google了一下
看來跟之前學過的ELK是差不多的東西
都是log管理的
不過之前在上ELK課的時候安裝有點複雜
想說還是繼續用splunk好了
不過graylog網站上就直接有ova可以下來用
不用再自己花時間裝 滿方便的
現在好像愈來愈多的軟体都醬做了
省得user安裝的麻煩
於是下載回來稍微玩了一下

ovf的os是用ubuntu 登入後記得改一下密碼
另外要改的是時區 預設使用的是UTC 記得改為自己的時區

sudo cp /usr/share/zoneinfo/Asia/Taipei /etc/localtime

再來就是要改graylog的config了
因為web介面上都不能改
路徑在
/opt/graylog/conf/graylog.conf

改web登入密碼
說明是要用shasum來hash
產生後直接複制貼上

# Create one by using for example: echo -n yourpassword | shasum -a 256
# and put the resulting hash value into the following line
root_password_sha2 = 895027ffec7981a554a916e76676677ee0d5da8bf35ff1ba7f15362e35a9781a

再來改時區 參考以下連結
http://www.joda.org/joda-time/timezones.html

root_timezone = Asia/Taipei

最後改一下搜尋結果顯示高亮

allow_highlighting = true

預設會有一支java起在 udp 514來收syslog
只要在其他設備上設定往這台丟就好了

至於如果要直接吃進file的內容
在splunk是只要直接設定就好了
但graylog比較麻煩
必須要再安裝 Collector Sidecar (支援由其他的机器丟至graylog)
裝好後先修改config file

/etc/graylog/collector-sidecar/collector_sidecar.yml
把tag的地方全部mark
tags:
#    - linux
#    - apache

然後再設定
操作流程請參考官方文件

http://docs.graylog.org/en/2.1/pages/collector_sidecar.html#graylog-collector-sidecar
http://docs.graylog.org/en/2.1/pages/sending_data.html

要注意的是input file 好像不能使用* 要一個一個指定

當log量大但hd容量不夠想限制儲存天數時
在管理介面上 system - indices - Edit
調整數量













在graylog.conf加上以下參數(依需求而定)

elasticsearch_max_time_per_index = 1d
elasticsearch_max_number_of_indices = 180
retention_strategy = delete

https://www.digitalocean.com/community/questions/how-to-config-graylog-data-save-days

目前使用起來感覺跟splunk差不多
不過splunk還是快一點
只是splunk免費版有每天500MB的限制就是了
如果有大量log需求又不想花錢
可以考慮看看

2016/03/05

最近在ubuntu 32 位元 開啟chrome時都會出現不在支援此版本的作業系統
表示以後不再支援32位元的版本了
今天要update時出現

W: 無法取得 http://dl.google.com/linux/chrome/deb/dists/stable/Release,在 Release 檔案找不到要有的「main/binary-i386/Packages」項目 (sources.list 項目有問題或檔案格式不對)

可是連64位元的os都出現 XD
要修正一下 source list

sudo sed -i -e 's/deb http/deb [arch=amd64] http/' "/etc/apt/sources.list.d/google-chrome.list"

2015/10/21

今天在思考一個問題
要不要把google的ip全部設成白名單
但首先要取得google的全部ip
指令如下

nslookup -q=TXT _netblocks.google.com 8.8.8.8

目前得到的資料如下

nslookup -q=TXT _netblocks.google.com 8.8.8.8
Server: 8.8.8.8
Address: 8.8.8.8#53

Non-authoritative answer:
_netblocks.google.com text = "v=spf1 ip4:64.18.0.0/20 ip4:64.233.160.0/19 ip4:66.102.0.0/20 ip4:66.249.80.0/20 ip4:72.14.192.0/18 ip4:74.125.0.0/16 ip4:108.177.8.0/21 ip4:173.194.0.0/16 ip4:207.126.144.0/20 ip4:209.85.128.0/17 ip4:216.58.192.0/19 ip4:216.239.32.0/19 ~all"

http://itindex.net/detail/50310-google-ip-%E6%96%B9%E6%B3%95

2015/05/08

在 mail server的log裡發現

postfix/smtp[1921]: 347A79E0739: to=<abc@gmail.com>, orig_to=<abc@bbb.edu.tw>, relay=alt1.gmail-smtp-in.l.google.com[74.125.25.27]:25, delay=239783, delays=239779/0.04/2.6/0.84, dsn=4.7.0, status=deferred (host alt1.gmail-smtp-in.l.google.com[74.125.25.27] said: 421-4.7.0 [2.3.4.5      15] Our system has detected an unusual rate of 421-4.7.0 unsolicited mail originating from your IP address. To protect our 421-4.7.0 users from spam, mail sent from your IP address has been temporarily 421-4.7.0 rate limited. Please visit 421-4.7.0 http://www.google.com/mail/help/bulk_mail.html to review our Bulk 421 4.7.0 Email Senders Guidelines. d5si4976585pdi.47 - gsmtp (in reply to end of DATA command))

被google擋信了
查了一下google的網頁說明
有三個方式可以處理
最方便的是在DNS設定spf

;spf for google
bbb.edu.tw.  3600  IN   TXT   "v=spf1 ip4:2.3.4.5 include:_spf.google.com ~all"

設定後重啟DNS
等cache更新後就ok了

2014/07/26

之前goole和adobe共同推出了免費的字型
一直想要換來用看看
今天下載回來解開後
想說依照之前的方法
應該很簡單
想不到放進去跑完
fc-cache -v -f 後
竟然沒有字可以選
再檢查了一下
發現google提供的是otf不是ttf
找了一下資料
發現解決的方式也很簡單
把libotf裝進來就好了

sudo apt-get install libotf-bin

再跑一次
fc-cache -v -f
就ok了

2014/04/12