Connecting to gtalk in irssi errors with 301 - xmpp

I have irssi and the xmpp plugin configured:
{
address = "talk.google.com";
chatnet = "Gtalk";
autoconnect = "yes";
port = "5223";
#use_ssl = "yes";
#ssl_verify = "yes";
ssl_capath = "/etc/ssl/certs";
}
and
Gtalk = { type = "XMPP"; nick = "neilhwatson#gmail.com"; };
This error is returned:
09:09 [Gtalk] -!- HTTP/1.1 301 Moved Permanently
09:09 [Gtalk] -!- Location: http://www.google.com/hangouts/
09:09 [Gtalk] -!- Content-Type: text/html
09:09 [Gtalk] -!- Content-Length: 178
Is there some other host or port combination that will work?

Using DNS SRV:
$ dig SRV _xmpp-client._tcp.gmail.com
;; ANSWER SECTION:
_xmpp-client._tcp.gmail.com. 337 IN SRV 20 0 5222 alt2.xmpp.l.google.com.
_xmpp-client._tcp.gmail.com. 337 IN SRV 20 0 5222 alt3.xmpp.l.google.com.
_xmpp-client._tcp.gmail.com. 337 IN SRV 5 0 5222 xmpp.l.google.com.
_xmpp-client._tcp.gmail.com. 337 IN SRV 20 0 5222 alt1.xmpp.l.google.com.
_xmpp-client._tcp.gmail.com. 337 IN SRV 20 0 5222 alt4.xmpp.l.google.com.
You could try using xmpp.l.google.com. My XMPP client (pidgin) seems to do this automatically when I tell it that the domain is "gmail.com"

Related

NOSRV errors seen in haproxy logs

We have haproxy in front of 2 apache servers and every day for less than a minute I am getting NOSRV errors in haproxy logs. There are successful requests from the source IP so this is just intermittent. There is no entry of any error in the backend logs.
Below is the snippet from access logs:
Dec 22 20:21:25 proxy01 haproxy[3000561]: X.X.X.X:60872 Local_Server~ Local_Server/<NOSRV> -1/-1/-1/ -1 0 0 0 {} "POST /xxxxtransaction HTTP/1.1" 0 0
Dec 22 20:21:26 proxy01 haproxy[3000561]: X.X.X.X:43212 Local_Server~ Local_Server/<NOSRV> -1/-1/-1/ -1 0 0 0 {} "POST /xxxxtransaction HTTP/1.1" 0 0
Dec 22 20:21:26 proxy01 haproxy[3000561]: X.X.X.X:43206 Local_Server~ Local_Server/<NOSRV> -1/-1/-1/ -1 0 0 0 {} "POST /xxxxtransaction HTTP/1.1" 0 0
Dec 22 20:21:26 proxy01 haproxy[3000561]: X.X.X.X:60974 Local_Server~ Local_Server/<NOSRV> -1/-1/-1/ -1 0 0 0 {} "POST /xxxxtransaction HTTP/1.1" 0 0
Dec 22 20:21:27 proxy01 haproxy[3000561]: X.X.X.X:32772 Local_Server~ Local_Server/<NOSRV> -1/-1/-1/ -1 0 0 0 {} "POST /xxxxtransaction HTTP/1.1" 103 0
Dec 22 20:21:27 proxy01 haproxy[3000561]: X.X.X.X:32774 Local_Server~ Local_Server/<NOSRV> -1/-1/-1/ -1 0 0 0 {} "POST /xxxxtransaction HTTP/1.1" 59 0
Dec 22 20:21:27 proxy01 haproxy[3000561]: X.X.X.X:32776 Local_Server~ Local_Server/<NOSRV> -1/-1/-1/ -1 0 0 0 {} "POST /xxxxtransaction HTTP/1.1" 57 0
below is the HAproxy config file:
defaults
log global
timeout connect 15000
timeout check 5000
timeout client 30000
timeout server 30000
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
frontend Local_Server
bind *:80
bind *:443 ssl crt /etc/haproxy/certs/
mode http
option httplog
cookie SRVNAME insert indirect nocache maxidle 8h maxlife 8h
#capture request header X-Forwarded-For len 15
#capture request header Host len 32
http-request capture req.hdrs len 512
log-format "%ci:%cp[%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r"
#log-format "%ci:%cp %ft %b/%s %Tw/%Tc/%Tr/ %ST %B %rc %bq %hr %hs %{+Q}r %Tt %Ta"
option dontlognull
option http-keep-alive
#declare whitelists for urls
acl xx_whitelist src -f /etc/haproxy/xx_whitelist.lst
acl is-blocked-ip src -f /etc/haproxy/badactors-list.txt
http-request silent-drop if is-blocked-ip
acl all src 0.0.0.0
######### ANTI BAD GUYS STUFF ###########################################
#anti DDOS sticktable - sends a 500 after 5s when requests from IP over 120 per
#frontend for stick table see backend "st_src_global" also
#Restrict number of requests in last 10 secs
# TO MONTOR RUN " watch -n 1 'echo "show table st_src_global" | socat unix:/run/haproxy/admin.sock -' " ON CLI.
#ZZZ THIS MAY NEED DISABLEING FOR LOAD TESTS ZZZZ
# Table definition
http-request track-sc0 src table st_src_global #<- defines tracking stick table
stick-table type ip size 100k expire 10s store http_req_rate(50000s) #<- sets the limit for and time to store IP
http-request silent-drop if { sc_http_req_rate(0) gt 50000 } # drops if requests are greater the 5000 in 5 secs
# Allow clean known IPs to bypass the filter
tcp-request connection accept if { src -f /etc/haproxy/xx_whitelist.lst }
#Slowlorris protection -send 408 if http request not completed in 5secs
timeout http-request 10s
option http-buffer-request
# Block Specific Requests
#http-request deny if HTTP_1.0
http-request deny if { req.hdr(user-agent) -i -m sub phantomjs slimerjs }
#traffic shape
#xxxx.xxxx.xx.xx
acl xxxxx.xxxxx.xx.xx hdr(host) -i xxxx.xxxx.xx.xx
use_backend xxxx.xxxx.xx.xx if xxxx.xxxx.xx.xx xx_whitelist #update from proxys
#sticktable for dos protection
backend st_src_global
stick-table type ip size 1m expire 10s store http_req_rate(50000s)
backend xxxxxxx.xxxxx.xx.xx
mode http
balance roundrobin
option forwardfor
http-request set-header X-Forwarded-Port %[dst_port]
http-request add-header X-Forwarded-Proto https if { ssl_fc }
server web01-http x.x.x.x:80 check maxconn 100
server web03-http x.x.x.x.:80 check maxconn 100

How does maxRequestsPerConnection of istio work?

everyone.
I have been learning istio and to understand how maxRequestsPerConnection works, I applied the manifest below.
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: httpbin
spec:
host: httpbin
trafficPolicy:
connectionPool:
http:
maxRequestsPerConnection: 1
httpbin is a sample service of istio.
I thought maxRequestsPerConnection means how many http requests are allowed per one TCP Connection, and istio would close tcp connection after pod received one http request in this case.
After applying, I sent some http requests using telnet. I thought istio would accept the request once and then close the TCP connection, but istio didn't.
$ telnet httpbin 8000
Trying 10.76.12.133...
Connected to httpbin.default.svc.cluster.local.
Escape character is '^]'.
GET /get HTTP/1.1
User-Agent: Telnet [ja] (Linux)
Host: httpbin
HTTP/1.1 200 OK
server: envoy
date: Sun, 07 Nov 2021 14:14:16 GMT
content-type: application/json
content-length: 579
access-control-allow-origin: *
access-control-allow-credentials: true
x-envoy-upstream-service-time: 9
{
"args": {},
"headers": {
"Host": "httpbin",
"User-Agent": "Telnet [ja] (Linux)",
"X-B3-Parentspanid": "b042ad708e2a47a2",
"X-B3-Sampled": "1",
"X-B3-Spanid": "b6a08d45e1a1e15e",
"X-B3-Traceid": "fc23863eafb0322db042ad708e2a47a2",
"X-Envoy-Attempt-Count": "1",
"X-Forwarded-Client-Cert": "By=spiffe://cluster.local/ns/default/sa/httpbin;Hash=d9bb27f31fe44200f803dbe736419b4664b5b81045bb3811711119ca5ccf6a37;Subject=\"\";URI=spiffe://cluster.local/ns/default/sa/default"
},
"origin": "127.0.0.6",
"url": "http://httpbin/get"
}
GET /get HTTP/1.1
User-Agent: Telnet [ja] (Linux)
Host: httpbin
HTTP/1.1 200 OK
server: envoy
date: Sun, 07 Nov 2021 14:14:18 GMT
content-type: application/json
content-length: 579
access-control-allow-origin: *
access-control-allow-credentials: true
x-envoy-upstream-service-time: 3
{
"args": {},
"headers": {
"Host": "httpbin",
"User-Agent": "Telnet [ja] (Linux)",
"X-B3-Parentspanid": "85722c0d777e8537",
"X-B3-Sampled": "1",
"X-B3-Spanid": "31d2acc5348a6fc5",
"X-B3-Traceid": "d7ada94a092d681885722c0d777e8537",
"X-Envoy-Attempt-Count": "1",
"X-Forwarded-Client-Cert": "By=spiffe://cluster.local/ns/default/sa/httpbin;Hash=d9bb27f31fe44200f803dbe736419b4664b5b81045bb3811711119ca5ccf6a37;Subject=\"\";URI=spiffe://cluster.local/ns/default/sa/default"
},
"origin": "127.0.0.6",
"url": "http://httpbin/get"
}
After this, I sent http request ten times using fortio, and I got the same result.
$ kubectl exec "$FORTIO_POD" -c fortio -- /usr/bin/fortio load -c 1 -qps 0 -n 10 -loglevel Warning http://httpbin:8000/get
14:22:56 I logger.go:127> Log level is now 3 Warning (was 2 Info)
Fortio 1.17.1 running at 0 queries per second, 2->2 procs, for 10 calls: http://httpbin:8000/get
Starting at max qps with 1 thread(s) [gomax 2] for exactly 10 calls (10 per thread + 0)
Ended after 106.50891ms : 10 calls. qps=93.889
Aggregated Function Time : count 10 avg 0.010648204 +/- 0.01639 min 0.003757335 max 0.059256801 sum 0.106482036
# range, mid point, percentile, count
>= 0.00375734 <= 0.004 , 0.00387867 , 30.00, 3
> 0.004 <= 0.005 , 0.0045 , 70.00, 4
> 0.005 <= 0.006 , 0.0055 , 80.00, 1
> 0.012 <= 0.014 , 0.013 , 90.00, 1
> 0.05 <= 0.0592568 , 0.0546284 , 100.00, 1
# target 50% 0.0045
# target 75% 0.0055
# target 90% 0.014
# target 99% 0.0583311
# target 99.9% 0.0591642
Sockets used: 1 (for perfect keepalive, would be 1)
Jitter: false
Code 200 : 10 (100.0 %)
Response Header Sizes : count 10 avg 230.1 +/- 0.3 min 230 max 231 sum 2301
Response Body/Total Sizes : count 10 avg 824.1 +/- 0.3 min 824 max 825 sum 8241
All done 10 calls (plus 0 warmup) 10.648 ms avg, 93.9 qps
$
In my understanding, the message Sockets used: 1 (for perfect keepalive, would be 1) means fortio used only one TCP connection.
I guessed clients used different tcp connection for each http requests first, but if it is true, telnet connection was not closed by foreign host and fortio used ten tcp connections.
Please teach me what the function of maxRequestsPerConnection is.

cURL fails in GitHub Actions

I'm running a Raspberry Pi 4 as a server for a .NET Core side-project of mine. Nothing too fancy or heavy. After trying to get going with a webhook and uploading files with scp to the Pi and failed (still don't know why at this point; scp problem might be the same as cURL problem), I decided to make myself a small API which accepts a file and deploys it to the specified path. The API is working both from inside and outside the Pi as I've tested it using cURL and Postman with a 20MB zip file, but when I run this command from inside a GitHub Action, I get a long waiting time and then a fail message.
Command:
curl --request POST --url https://example.com/ --header 'cache-control: no-cache' --form path=DEPLOY_PATH --form archive=#FILE_PATH --form token=TOKEN
Output:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 8776k 0 0 0 65536 0 42750 0:03:30 0:00:01 0:03:29 42722
0 8776k 0 0 0 65536 0 25862 0:05:47 0:00:02 0:05:45 25852
0 8776k 0 0 0 65536 0 18533 0:08:04 0:00:03 0:08:01 18528
0 8776k 0 0 0 65536 0 14444 0:10:22 0:00:04 0:10:18 14441
0 8776k 0 0 0 65536 0 11833 0:12:39 0:00:05 0:12:34 13091
0 8776k 0 0 0 65536 0 10022 0:14:56 0:00:06 0:14:50 0
0 8776k 0 0 0 65536 0 8691 0:17:14 0:00:07 0:17:07 0
...
0 8776k 0 0 0 65536 0 63 39:37:37 0:17:11 39:20:26 0
0 8776k 0 0 0 65536 0 63 39:37:37 0:17:11 39:20:26 0
curl: (55) SSL_write() returned SYSCALL, errno = 110
##[error]Process completed with exit code 55.
With both scp and cURL commands there seems to be a common problem. If I try to send a simple text file or a tar.gz containing a text.file, it works. If I try to do the same with a .dll file or a tar.gz containing a .dll file, it does not. I don't really know if the problem is because of the files or their size. To be noted that the API accepts files as big as 100MB at the moment and I'm only trying to deploy a small package of ~10MB.
Output with -v arg:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying IP...
* TCP_NODELAY set
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to URL (IP) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
* TLSv1.3 (IN), TLS handshake, Server hello (2):
{ [112 bytes data]
* TLSv1.2 (IN), TLS handshake, Certificate (11):
{ [2861 bytes data]
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
{ [300 bytes data]
* TLSv1.2 (IN), TLS handshake, Server finished (14):
{ [4 bytes data]
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
} [37 bytes data]
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
} [1 bytes data]
* TLSv1.2 (OUT), TLS handshake, Finished (20):
} [16 bytes data]
* TLSv1.2 (IN), TLS handshake, Finished (20):
{ [16 bytes data]
* SSL connection using TLSv1.2 / ECDHE-RSA-CHACHA20-POLY1305
* ALPN, server accepted to use http/1.1
* Server certificate:
* subject: CN=URL
* start date: Sep 18 16:51:41 2020 GMT
* expire date: Dec 17 16:51:41 2020 GMT
* subjectAltName: host "URL" matched cert's "URL"
* issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
* SSL certificate verify ok.
} [5 bytes data]
> POST /api/Deployment/ HTTP/1.1
> Host: URL
> User-Agent: curl/7.58.0
> Accept: */*
> cache-control: no-cache
> Content-Length: 3333
> Content-Type: multipart/form-data; boundary=------------------------ca1748c91973ca89
> Expect: 100-continue
>
{ [5 bytes data]
< HTTP/1.1 100 Continue
} [5 bytes data]
100 3333 0 0 100 3333 0 2154 0:00:01 0:00:01 --:--:-- 2153
100 3333 0 0 100 3333 0 1307 0:00:02 0:00:02 --:--:-- 1307
100 3333 0 0 100 3333 0 938 0:00:03 0:00:03 --:--:-- 938
100 3333 0 0 100 3333 0 732 0:00:04 0:00:04 --:--:-- 732
100 3333 0 0 100 3333 0 600 0:00:05 0:00:05 --:--:-- 614
100 3333 0 0 100 3333 0 508 0:00:06 0:00:06 --:--:-- 0
100 3333 0 0 100 3333 0 441 0:00:07 0:00:07 --:--:-- 0
...
100 3333 0 0 100 3333 0 57 0:00:58 0:00:57 0:00:01 0
100 3333 0 0 100 3333 0 56 0:00:59 0:00:58 0:00:01 0
100 3333 0 0 100 3333 0 55 0:01:00 0:00:59 0:00:01 0
100 3333 0 0 100 3333 0 54 0:01:01 0:01:00 0:00:01 0* Empty reply from server
100 3333 0 0 100 3333 0 54 0:01:01 0:01:00 0:00:01 0
* Connection #0 to host URL left intact
curl: (52) Empty reply from server
##[error]Process completed with exit code 52.
EDIT: Switching to a Windows runner instead of Ubuntu solved the cURL problem, but I'm still open to suggestions regarding this question, as this is merely a workaround rather than a solution.

Facebook share error: Object at URL of type 'website' is invalid because a required property 'og:title' of type 'string' was not provided

โœ‹๐Ÿฝ
When I paste the URL of my blog in Facebook debugger, its not picking the title and also the image. In view source of my page, the og:title and also og:image are getting rendered but facebook scraper is not reading any.
Object at URL 'http://blog.la-pigiste.com/2017/09/20/diy-faire-son-terrazzo-granito-do-it-yourself-inspiration-tendance-tutoriel/' of type 'website' is invalid because a required property 'og:title' of type 'string' was not provided.
Facebook debugger also says "{
"error": {
"message": "An access token is required to request this resource.",
"type": "OAuthException",
"code": 104,
"fbtrace_id": "BMdGG7oTu6k"
}
}"
but i don't no what does it means .... ๐Ÿค”
any help is greatly appreciated ๐Ÿ™๐Ÿป
When trying to fetch new scrape information for your URL through the Open Graph Debugger you get the error:
Curl Error : OPERATION_TIMEOUTED Operation timed out after 10000 milliseconds with 0 bytes received
In other words, your web server didn't reply in 10 seconds and the crawler timed out.
It looks like you configured your web server to behave differently when the request is coming from the Facebook Crawler.
You can verify this using curl.
Fetching your URL with curl's default User Agent works fine:
$ curl -v 'http://blog.la-pigiste.com/2017/09/20/diy-faire-son-terrazzo-granito-do-it-yourself-inspiration-tendance-tutoriel/' > /dev/null
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 149.56.140.68...
* TCP_NODELAY set
* Connected to blog.la-pigiste.com (149.56.140.68) port 80 (#0)
> GET /2017/09/20/diy-faire-son-terrazzo-granito-do-it-yourself-inspiration-tendance-tutoriel/ HTTP/1.1
> Host: blog.la-pigiste.com
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: nginx
< Date: Wed, 20 Sep 2017 10:34:37 GMT
< Content-Type: text/html; charset=UTF-8
< Content-Length: 117446
< Connection: keep-alive
< Vary: Accept-Encoding
< Last-Modified: Wed, 20 Sep 2017 07:25:20 GMT
< Accept-Ranges: bytes
< Vary: Accept-Encoding
< X-Powered-By: PleskLin
< Cache-Control: max-age=0, no-cache, no-store, must-revalidate
< Pragma: no-cache
< Expires: Mon, 29 Oct 1923 20:30:00 GMT
<
{ [956 bytes data]
100 114k 100 114k 0 0 159k 0 --:--:-- --:--:-- --:--:-- 159k
* Connection #0 to host blog.la-pigiste.com left intact
Anyway, when the Facebook crawler User Agent is used (facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)), the web server replies differently and only after about 14 seconds:
$ curl -v -A "facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)" 'http://blog.la-pigiste.com/2017/09/20/diy-faire-son-terrazzo-granito-do-it-yourself-inspiration-tendance-tutoriel/' > /dev/null
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 149.56.140.68...
* TCP_NODELAY set
* Connected to blog.la-pigiste.com (149.56.140.68) port 80 (#0)
> GET /2017/09/20/diy-faire-son-terrazzo-granito-do-it-yourself-inspiration-tendance-tutoriel/ HTTP/1.1
> Host: blog.la-pigiste.com
> User-Agent: facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)
> Accept: */*
>
0 0 0 0 0 0 0 0 --:--:-- 0:00:14 --:--:-- 0< HTTP/1.1 200 OK
< Server: nginx
< Date: Wed, 20 Sep 2017 10:37:15 GMT
< Content-Type: text/html; charset=UTF-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Vary: Accept-Encoding
< X-Powered-By: PHP/5.6.30
< X-Pingback: http://blog.la-pigiste.com/xmlrpc.php
< Link: <http://blog.la-pigiste.com/wp-json/>; rel="https://api.w.org/", <...>; rel=shortlink
< Set-Cookie: wfvt_983661238=59c244cfe4c12; expires=Wed, 20-Sep-2017 11:07:03 GMT; Max-Age=1800; path=/; httponly
< Vary: Accept-Encoding
< X-Powered-By: PleskLin
<
{ [838 bytes data]
100 124k 0 124k 0 0 8507 0 --:--:-- 0:00:15 --:--:-- 36126
* Connection #0 to host blog.la-pigiste.com left intact
Ensure that your web server replies in time and with the correct HTML and the crawler will be able to fetch your OG tags.

date is error when run zabbix_bind.9.6_stats.pl on Solaris

analyse named.stats file On Solaris 10, SunOS azalea 5.10 Generic_150400-13 sun4u sparc SUNW,Sun-Fire-V490
perl version: v5.8.4 built for sun4-solaris-64int
BIND 9.9.5-P1, this dns has view zone!
When I ran zabbix_bind.9.6_stats.pl script, the date in the first line of the result file zabbix_named.stats.txt is wrong.
Input file: named.stats
+++ Statistics Dump +++ (1411256097)
++ Incoming Requests ++
245677755 QUERY
11 IQUERY
131 NOTIFY
5 UPDATE
++ Incoming Queries ++
7 RESERVED0
214646337 A
195659 NS
194834 CNAME
67573 SOA
11863353 PTR
13 HINFO
311508 MX
80961 TXT
17684359 AAAA
313197 SRV
35 NAPTR
1026 A6
377 DS
2 NSEC
16 DNSKEY
2658 SPF
6 AXFR
317449 ANY
14 Others
++ Outgoing Queries ++
[View: GLU]
97641561 A
913138 NS
1668 CNAME
3496 SOA
584400 PTR
215941 MX
222061 TXT
8968008 AAAA
10839 SRV
74 DS
1 DNSKEY
11600 ANY
[View: Other]
[View: _bind]
++ Name Server Statistics ++
245679139 IPv4 requests received
6939549 requests with EDNS(0) received
29010 requests with TSIG received
56072 TCP requests received
1735225 auth queries rejected
50400546 recursive queries rejected
6 transfer requests rejected
231559258 responses sent
39867 truncated responses sent
6886241 responses with EDNS(0) sent
28879 responses with TSIG sent
134630025 queries resulted in successful answer
7564120 queries resulted in authoritative answer
145275533 queries resulted in non authoritative answer
33203 queries resulted in referral answer
8608506 queries resulted in nxrrset
26580073 queries resulted in SERVFAIL
9569385 queries resulted in NXDOMAIN
86774948 queries caused recursion
12879202 duplicate queries received
1239821 queries dropped
52135771 other query failures
++ Zone Maintenance Statistics ++
130 IPv4 notifies received
4114 IPv4 SOA queries sent
20 IPv4 AXFR requested
10 IPv4 IXFR requested
30 transfer requests succeeded
++ Resolver Statistics ++
[Common]
223764 mismatch responses received
[View: GLU]
108570571 IPv4 queries sent
76450226 IPv4 responses received
519727 NXDOMAIN received
150555 SERVFAIL received
50543 FORMERR received
394845 other errors received
64245 EDNS(0) query failures
6679270 truncated responses received
77150 lame delegations received
39157947 query retries
32176451 query timeouts
2446839 IPv4 NS address fetches
131398 IPv4 NS address fetch failed
10663 queries with RTT < 10ms
55311397 queries with RTT 10-100ms
17022288 queries with RTT 100-500ms
3465431 queries with RTT 500-800ms
455258 queries with RTT 800-1600ms
12639 queries with RTT > 1600ms
[View: Other]
[View: _bind]
++ Cache DB RRsets ++
[View: GLU (Cache: GLU)]
20848 A
28539 NS
4810 CNAME
4 SOA
140 PTR
4 MX
18 TXT
1523 AAAA
1 SRV
167 DS
774 RRSIG
423 NSEC
1 DNSKEY
20 !A
5 !TXT
314 !AAAA
237 NXDOMAIN
[View: Other (Cache: Other)]
[View: _bind (Cache: _bind)]
++ Socket I/O Statistics ++
101917427 UDP/IPv4 sockets opened
6679398 TCP/IPv4 sockets opened
101934142 UDP/IPv4 sockets closed
6736965 TCP/IPv4 sockets closed
32659 UDP/IPv4 socket bind failures
1614 TCP/IPv4 socket connect failures
101889277 UDP/IPv4 connections established
6417057 TCP/IPv4 connections established
622 TCP/IPv4 connection accept failures
57536 TCP/IPv4 connections accepted
5 TCP/IPv4 send errors
173008 UDP/IPv4 recv errors
37707 TCP/IPv4 recv errors
++ Per Zone Query Statistics ++
[0.0.127.in-addr.arpa (view: GLU)]
27 queries resulted in successful answer
164 queries resulted in authoritative answer
137 queries resulted in NXDOMAIN
[160.192.222.in-addr.arpa (view: GLU)]
141 queries resulted in successful answer
792 queries resulted in authoritative answer
651 queries resulted in NXDOMAIN
[0.0.127.in-addr.arpa (view: Other)]
[160.192.222.in-addr.arpa (view: Other)]
92115 queries resulted in successful answer
106915 queries resulted in authoritative answer
123 queries resulted in nxrrset
14677 queries resulted in NXDOMAIN
[glu.edu.cn (view: Other)]
5 transfer requests rejected
1764308 queries resulted in successful answer
2849091 queries resulted in authoritative answer
574347 queries resulted in nxrrset
510456 queries resulted in NXDOMAIN
[version.bind (view: _bind)]
264 queries resulted in successful answer
264 queries resulted in authoritative answer
[hostname.bind (view: _bind)]
3 queries resulted in successful answer
3 queries resulted in authoritative answer
[authors.bind (view: _bind)]
[id.server (view: _bind)]
--- Statistics Dump --- (1411256097)
+++ Statistics Dump +++ (1411256113)
++ Incoming Requests ++
245678141 QUERY
11 IQUERY
131 NOTIFY
5 UPDATE
++ Incoming Queries ++
7 RESERVED0
214646692 A
195659 NS
194834 CNAME
67578 SOA
11863360 PTR
13 HINFO
311512 MX
80961 TXT
17684371 AAAA
313199 SRV
35 NAPTR
1026 A6
377 DS
2 NSEC
16 DNSKEY
2658 SPF
6 AXFR
317450 ANY
14 Others
++ Outgoing Queries ++
[View: GLU]
97641832 A
913147 NS
1668 CNAME
3496 SOA
584400 PTR
215944 MX
222061 TXT
8968013 AAAA
10839 SRV
74 DS
1 DNSKEY
11600 ANY
[View: Other]
[View: _bind]
++ Name Server Statistics ++
245679525 IPv4 requests received
6939573 requests with EDNS(0) received
29010 requests with TSIG received
56072 TCP requests received
1735231 auth queries rejected
50400606 recursive queries rejected
6 transfer requests rejected
231559636 responses sent
39867 truncated responses sent
6886265 responses with EDNS(0) sent
28879 responses with TSIG sent
134630301 queries resulted in successful answer
7564152 queries resulted in authoritative answer
145275810 queries resulted in non authoritative answer
33203 queries resulted in referral answer
8608514 queries resulted in nxrrset
26580076 queries resulted in SERVFAIL
9569410 queries resulted in NXDOMAIN
86775072 queries caused recursion
12879204 duplicate queries received
1239821 queries dropped
52135837 other query failures
++ Zone Maintenance Statistics ++
130 IPv4 notifies received
4114 IPv4 SOA queries sent
20 IPv4 AXFR requested
10 IPv4 IXFR requested
30 transfer requests succeeded
++ Resolver Statistics ++
[Common]
223769 mismatch responses received
[View: GLU]
108570859 IPv4 queries sent
76450431 IPv4 responses received
519730 NXDOMAIN received
150555 SERVFAIL received
50543 FORMERR received
394845 other errors received
64245 EDNS(0) query failures
6679285 truncated responses received
77150 lame delegations received
39158038 query retries
32176528 query timeouts
2446848 IPv4 NS address fetches
131398 IPv4 NS address fetch failed
10663 queries with RTT < 10ms
55311569 queries with RTT 10-100ms
17022314 queries with RTT 100-500ms
3465436 queries with RTT 500-800ms
455260 queries with RTT 800-1600ms
12639 queries with RTT > 1600ms
[View: Other]
[View: _bind]
++ Cache DB RRsets ++
[View: GLU (Cache: GLU)]
20863 A
28540 NS
4848 CNAME
4 SOA
140 PTR
4 MX
18 TXT
1523 AAAA
1 SRV
167 DS
774 RRSIG
423 NSEC
1 DNSKEY
20 !A
5 !TXT
307 !AAAA
240 NXDOMAIN
[View: Other (Cache: Other)]
[View: _bind (Cache: _bind)]
++ Socket I/O Statistics ++
101917700 UDP/IPv4 sockets opened
6679413 TCP/IPv4 sockets opened
101934409 UDP/IPv4 sockets closed
6736981 TCP/IPv4 sockets closed
32659 UDP/IPv4 socket bind failures
1614 TCP/IPv4 socket connect failures
101889550 UDP/IPv4 connections established
6417072 TCP/IPv4 connections established
622 TCP/IPv4 connection accept failures
57537 TCP/IPv4 connections accepted
5 TCP/IPv4 send errors
173008 UDP/IPv4 recv errors
37707 TCP/IPv4 recv errors
++ Per Zone Query Statistics ++
[0.0.127.in-addr.arpa (view: GLU)]
27 queries resulted in successful answer
164 queries resulted in authoritative answer
137 queries resulted in NXDOMAIN
[160.192.222.in-addr.arpa (view: GLU)]
141 queries resulted in successful answer
792 queries resulted in authoritative answer
651 queries resulted in NXDOMAIN
[glu.edu.cn (view: GLU)]
390933 queries resulted in successful answer
485439 queries resulted in authoritative answer
56638 queries resulted in nxrrset
37870 queries resulted in NXDOMAIN
[0.0.127.in-addr.arpa (view: Other)]
[160.192.222.in-addr.arpa (view: Other)]
92115 queries resulted in successful answer
106915 queries resulted in authoritative answer
123 queries resulted in nxrrset
14677 queries resulted in NXDOMAIN
[glu.edu.cn (view: Other)]
5 transfer requests rejected
1764319 queries resulted in successful answer
2849104 queries resulted in authoritative answer
574349 queries resulted in nxrrset
510456 queries resulted in NXDOMAIN
[GLU.cn (view: Other)]
1 transfer requests rejected
63626 queries resulted in successful answer
243178 queries resulted in authoritative answer
42873 queries resulted in nxrrset
136679 queries resulted in NXDOMAIN
[version.bind (view: _bind)]
264 queries resulted in successful answer
264 queries resulted in authoritative answer
[hostname.bind (view: _bind)]
3 queries resulted in successful answer
3 queries resulted in authoritative answer
[authors.bind (view: _bind)]
[id.server (view: _bind)]
--- Statistics Dump --- (1411256113)
Output file: /tmp/zabbix_named.stats.txt
date: 0 Thu Jan 1 08:00:00 1970
Per_Zone_Query_Statistics_Zone_0.0.127.in-addr.arpa__view__GLU__queries_resulted_in_NXDOMAIN: 137
Per_Zone_Query_Statistics_Zone_0.0.127.in-addr.arpa__view__GLU__queries_resulted_in_authoritative_answer: 164
Per_Zone_Query_Statistics_Zone_0.0.127.in-addr.arpa__view__GLU__queries_resulted_in_successful_answer: 27
Per_Zone_Query_Statistics_Zone_160.192.222.in-addr.arpa__view__CERNET__queries_resulted_in_NXDOMAIN: 32er: 423
Per_Zone_Query_Statistics_Zone_160.192.222.in-addr.arpa__view__GLU__queries_resulted_in_NXDOMAIN: 651
Per_Zone_Query_Statistics_Zone_160.192.222.in-addr.arpa__view__GLU__queries_resulted_in_authoritative_answer: 792
Per_Zone_Query_Statistics_Zone_160.192.222.in-addr.arpa__view__GLU__queries_resulted_in_successful_answer: 141
Per_Zone_Query_Statistics_Zone_160.192.222.in-addr.arpa__view__Other__queries_resulted_in_NXDOMAIN: 14678
Per_Zone_Query_Statistics_Zone_160.192.222.in-addr.arpa__view__Other__queries_resulted_in_authoritative_answer: 106920
Per_Zone_Query_Statistics_Zone_160.192.222.in-addr.arpa__view__Other__queries_resulted_in_nxrrset: 124
Per_Zone_Query_Statistics_Zone_160.192.222.in-addr.arpa__view__Other__queries_resulted_in_successful_answer: 92118
Per_Zone_Query_Statistics_Zone_glu.edu.cn__view__GLU__queries_resulted_in_NXDOMAIN: 37890
Per_Zone_Query_Statistics_Zone_glu.edu.cn__view__GLU__queries_resulted_in_authoritative_answer: 485515
Per_Zone_Query_Statistics_Zone_glu.edu.cn__view__GLU__queries_resulted_in_nxrrset: 56662
Per_Zone_Query_Statistics_Zone_glu.edu.cn__view__GLU__queries_resulted_in_successful_answer: 390965
Per_Zone_Query_Statistics_Zone_glu.edu.cn__view__Other__queries_resulted_in_NXDOMAIN: 510477
Per_Zone_Query_Statistics_Zone_glu.edu.cn__view__Other__queries_resulted_in_authoritative_answer: 2849383
Per_Zone_Query_Statistics_Zone_glu.edu.cn__view__Other__queries_resulted_in_nxrrset: 574397
Per_Zone_Query_Statistics_Zone_glu.edu.cn__view__Other__queries_resulted_in_successful_answer: 1764529
Per_Zone_Query_Statistics_Zone_glu.edu.cn__view__Other__transfer_requests_rejected: 5
Per_Zone_Query_Statistics_Zone_hostname.bind__view___bind__queries_resulted_in_authoritative_answer: 3
Per_Zone_Query_Statistics_Zone_hostname.bind__view___bind__queries_resulted_in_successful_answer: 3
Per_Zone_Query_Statistics_Zone_version.bind__view___bind__queries_resulted_in_authoritative_answer: 266
Per_Zone_Query_Statistics_Zone_version.bind__view___bind__queries_resulted_in_successful_answer: 266
zabbix_bind.9.6_stats.pl (from https://www.zabbix.com/forum/showthread.php?t=38970):
#!/usr/bin/perl
# Dmitry Maksimov 5.02.2013 dima_dm#hotmail.com
# bind 9.6.X and high statistics for Zabbix
#######
# Need!!! perl-suidperl-5.8.5-36.el4_6.3.i386.rpm or later
# Permissions on script
# chmod 4755 zabbix_bind.9.6_stats.pl
# ls -l zabbix_bind.9.6_stats.pl
# -rwsr-xr-x 1 root root 2876 Feb 5 17:40 zabbix_bind.9.6_stats.pl
# Per Zone Query Statistics via Zabbix Low Level Descovery (LLD) (bind option zone-statistics yes) which is only available in Zabbix 2.0 and high.
#### Config ######
my $rndc = '/usr/local/bind9/sbin/rndc';
my $retry = 3; # if error
my $sleep = 5; # in sec
my $data = 10000; # in bytes, size of one statictics sample
my $maxsize
= 5000000; # in bytes $stats file maximum size. If size of file more, whis file ($stats) will be cleared.
my $stats = '/var/named/named.stats';
my $stat_file = '/tmp/zabbix_named.stats.txt';
#### End Config ###
#### Error Code ####
# 1 - OK
# 2 - Error
####################
my $i;
my $date = 0;
my $flag = 0;
my $stat_name = "";
my $zone = "";
my $text = "";
my $counter = "";
my $view = "";
my $code = 1;
my %RESULT = ();
my %ZONENAME = ();
delete #ENV{qw(IFS CDPATH ENV BASH_ENV)}; # Make %ENV safer
$ENV{'PATH'} = "/usr/local/bin:/bin:/usr/bin";
while ( $code > 0 && $i < $retry ) {
$i++;
$code = system("$rndc stats");
if ( $code > 0 ) { sleep($sleep); }
}
my $position = ( stat($stats) )[7];
if ( $position < $data ) {
$position = 0;
} else {
$position = $position - $data;
}
open( FILE, "$stats" );
seek( FILE, $position, 0 );
while (<FILE>) {
if (/^\+{3} Statistics Dump \+{3}\s+\((\d+)\)/) { $date = $1; $flag = 1; %RESULT = (); }
if (/^--- Statistics Dump ---/) { $flag = 0; }
if (/^\+{2}\s+(.*)?\s+(?=\+{2})/) {
$stat_name = $1;
$view = "";
if ( $stat_name eq "Per Zone Query Statistics" ) { $flag = 2; $zone = ""; }
}
if (/^\[View:\s+(.*)?(?=\])/) { $view = "_View_" . $1; }
if ( /^\[(.*)?(?=\])/ && $flag == 2 ) { $zone = "_Zone_" . $1; $zone =~ s#[^a-zA-Z0-9_\.\-]#_#g; }
if ( /^\s+(\d+)\s+(.*)?(?=\n)/ && $flag == 1 ) {
$text = $stat_name . $view . "_" . $2;
$counter = $1;
$text =~ s#[^a-zA-Z0-9_\.\-]#_#g;
$RESULT{$text} = $counter;
}
if ( /^\s+(\d+)\s+(.*)?(?=\n)/ && $flag == 2 ) {
$text = $stat_name . $zone . "_" . $2;
$counter = $1;
$text =~ s#[^a-zA-Z0-9_\.\-]#_#g;
$RESULT{$text} = $counter;
$ZONENAME{$zone} = 1;
}
}
close(FILE);
if ( ( stat($stats) )[7] > $maxsize ) {
open( FILE, ">$stats" );
close(FILE);
}
open( FILE, ">$stat_file" );
print FILE "date: $date ", scalar( localtime($date) ), "\n";
foreach $i ( sort( keys %RESULT ) ) {
print FILE "$i:\t$RESULT{$i}\n";
}
close(FILE);
if ( defined( $ARGV[0] ) && lc( $ARGV[0] ) eq "lld" ) {
print_lld();
} else {
if ( $code > 0 ) {
print "2\n";
} else {
print "1\n";
}
}
sub print_lld {
my $first = 1;
my $key = "";
print "{\n";
print "\t\"data\":[\n\n";
foreach $key ( keys %ZONENAME ) {
print "\t,\n" if not $first;
$first = 0;
print "\t{\n";
print "\t\t\"{#ZONENAME}\":\"$key\"\n";
print "\t}\n";
}
print "\n\t]\n";
print "}\n";
}
When I run it in Other machince, Date value is ok!
This machince: SunOS orchid 5.10 Generic_150400-13 sun4u sparc SUNW,Ultra-4
perl version: v5.8.4 built for sun4-solaris-64int
BIND 9.9.5-P1, But this dns has not view zone!
Input file: named.stats
+++ Statistics Dump +++ (1411352600)
++ Incoming Requests ++
331205 QUERY
++ Incoming Queries ++
174193 A
1045 NS
103 CNAME
760 SOA
103046 PTR
276 MX
18 TXT
41567 AAAA
49 SRV
286 A6
2 NSEC
9863 ANY
++ Outgoing Queries ++
[View: default]
190903 A
1443 NS
971 PTR
1225 AAAA
24 SRV
[View: _bind]
++ Name Server Statistics ++
331207 IPv4 requests received
177845 requests with EDNS(0) received
23 TCP requests received
38595 auth queries rejected
2468 recursive queries rejected
330359 responses sent
27 truncated responses sent
177847 responses with EDNS(0) sent
227691 queries resulted in successful answer
197399 queries resulted in authoritative answer
91628 queries resulted in non authoritative answer
41394 queries resulted in nxrrset
267 queries resulted in SERVFAIL
19942 queries resulted in NXDOMAIN
78029 queries caused recursion
851 duplicate queries received
41063 other query failures
++ Zone Maintenance Statistics ++
513 IPv4 SOA queries sent
++ Resolver Statistics ++
[Common]
[View: default]
194568 IPv4 queries sent
188556 IPv4 responses received
1113 NXDOMAIN received
91 SERVFAIL received
863 FORMERR received
30 other errors received
877 EDNS(0) query failures
274 truncated responses received
200 lame delegations received
16212 query retries
6142 query timeouts
28491 IPv4 NS address fetches
84 IPv4 NS address fetch failed
111 queries with RTT < 10ms
144059 queries with RTT 10-100ms
44047 queries with RTT 100-500ms
250 queries with RTT 500-800ms
3 queries with RTT 800-1600ms
[View: _bind]
++ Cache DB RRsets ++
[View: default]
1087 A
583 NS
191 CNAME
1 PTR
174 AAAA
21 DS
74 RRSIG
17 NSEC
1 !A
2 NXDOMAIN
[View: _bind (Cache: _bind)]
++ Socket I/O Statistics ++
194826 UDP/IPv4 sockets opened
277 TCP/IPv4 sockets opened
194826 UDP/IPv4 sockets closed
298 TCP/IPv4 sockets closed
19 UDP/IPv4 socket bind failures
194291 UDP/IPv4 connections established
48 TCP/IPv4 connections established
25 TCP/IPv4 connections accepted
87 UDP/IPv4 recv errors
++ Per Zone Query Statistics ++
--- Statistics Dump --- (1411352600)
Output file: /tmp/zabbix_named.stats.txt
date: 1411352600 Mon Sep 22 10:23:20 2014
Cache_DB_RRsets_View_default_A: 1087
Cache_DB_RRsets_View_default_AAAA: 174
Cache_DB_RRsets_View_default_CNAME: 191
Cache_DB_RRsets_View_default_DS: 21
Cache_DB_RRsets_View_default_NS: 583
Cache_DB_RRsets_View_default_NSEC: 17
Cache_DB_RRsets_View_default_NXDOMAIN: 2
Cache_DB_RRsets_View_default_PTR: 1
Cache_DB_RRsets_View_default_RRSIG: 74
Cache_DB_RRsets_View_default__A: 1
Incoming_Queries_A: 174193
Incoming_Queries_A6: 286
Incoming_Queries_AAAA: 41567
Incoming_Queries_ANY: 9863
Incoming_Queries_CNAME: 103
Incoming_Queries_MX: 276
Incoming_Queries_NS: 1045
Incoming_Queries_NSEC: 2
Incoming_Queries_PTR: 103046
Incoming_Queries_SOA: 760
Incoming_Queries_SRV: 49
Incoming_Queries_TXT: 18
Incoming_Requests_QUERY: 331205
Name_Server_Statistics_IPv4_requests_received: 331207
Name_Server_Statistics_TCP_requests_received: 23
Name_Server_Statistics_auth_queries_rejected: 38595
Name_Server_Statistics_duplicate_queries_received: 851
Name_Server_Statistics_other_query_failures: 41063
Name_Server_Statistics_queries_caused_recursion: 78029
Name_Server_Statistics_queries_resulted_in_NXDOMAIN: 19942
Name_Server_Statistics_queries_resulted_in_SERVFAIL: 267
Name_Server_Statistics_queries_resulted_in_authoritative_answer: 197399
Name_Server_Statistics_queries_resulted_in_non_authoritative_answer: 91628
Name_Server_Statistics_queries_resulted_in_nxrrset: 41394
Name_Server_Statistics_queries_resulted_in_successful_answer: 227691
Name_Server_Statistics_recursive_queries_rejected: 2468
Name_Server_Statistics_requests_with_EDNS_0__received: 177845
Name_Server_Statistics_responses_sent: 330359
Name_Server_Statistics_responses_with_EDNS_0__sent: 177847
Name_Server_Statistics_truncated_responses_sent: 27
Outgoing_Queries_View_default_A: 190903
Outgoing_Queries_View_default_AAAA: 1225
Outgoing_Queries_View_default_NS: 1443
Outgoing_Queries_View_default_PTR: 971
Outgoing_Queries_View_default_SRV: 24
Resolver_Statistics_View_default_EDNS_0__query_failures: 877
Resolver_Statistics_View_default_FORMERR_received: 863
Resolver_Statistics_View_default_IPv4_NS_address_fetch_failed: 84
Resolver_Statistics_View_default_IPv4_NS_address_fetches: 28491
Resolver_Statistics_View_default_IPv4_queries_sent: 194568
Resolver_Statistics_View_default_IPv4_responses_received: 188556
Resolver_Statistics_View_default_NXDOMAIN_received: 1113
Resolver_Statistics_View_default_SERVFAIL_received: 91
Resolver_Statistics_View_default_lame_delegations_received: 200
Resolver_Statistics_View_default_other_errors_received: 30
Resolver_Statistics_View_default_queries_with_RTT_10-100ms: 144059
Resolver_Statistics_View_default_queries_with_RTT_100-500ms: 44047
Resolver_Statistics_View_default_queries_with_RTT_500-800ms: 250
Resolver_Statistics_View_default_queries_with_RTT_800-1600ms: 3
Resolver_Statistics_View_default_queries_with_RTT___10ms: 111
Resolver_Statistics_View_default_query_retries: 16212
Resolver_Statistics_View_default_query_timeouts: 6142
Resolver_Statistics_View_default_truncated_responses_received: 274
Socket_I_O_Statistics_TCP_IPv4_connections_accepted: 25
Socket_I_O_Statistics_TCP_IPv4_connections_established: 48
Socket_I_O_Statistics_TCP_IPv4_sockets_closed: 298
Socket_I_O_Statistics_TCP_IPv4_sockets_opened: 277
Socket_I_O_Statistics_UDP_IPv4_connections_established: 194291
Socket_I_O_Statistics_UDP_IPv4_recv_errors: 87
Socket_I_O_Statistics_UDP_IPv4_socket_bind_failures: 19
Socket_I_O_Statistics_UDP_IPv4_sockets_closed: 194826
Socket_I_O_Statistics_UDP_IPv4_sockets_opened: 194826
Zone_Maintenance_Statistics_IPv4_SOA_queries_sent: 513
The date in the output file is set to 0 initially, and then gets parsed from named.stats in this line of the script:
if (/^\+{3} Statistics Dump \+{3}\s+\((\d+)\)/) { $date = $1; $flag = 1; %RESULT = (); }
The date and time are recorded in named.stats in Unix time, the number of seconds after Jan 1st 1970.
If, for some reason, that line of the stats file does not match this expression, the date will not get set, and the script will assume that the date/time is 0, i.e. that it's Jan 1st 1970.
You will need to work out why the script is not finding the date correctly. Was named.stats available when the script ran? Did the script give any errors? Has your system clock stopped working so it thinks it's Jan 1st 1970 all the time? Etc.
If you add use strict; use warnings; to the top of the script (under the first line), this will enable warnings which will make it easier to track down errors.
Author of the script answer my question in zabbix forum:
that size ะพf one statistics sample < $data in Byte.
my $data=10000
I set to my $data > size ะพf named.stats.
It works fine.
thinks!