@cryptotaxi247 / netdata-1 / commits / f76a80cfc

set update_every default to 5, update comments, separate out syscall, clean up family naming a bit.

Christopher Cox committed Apr 24, 2017 at 09:57 UTC f76a80cfc31794e720b0f0b58bbf323641f6602a
1 file changed +16 -25
python.d/samba.chart.py
+16 -25
@@ -2,31 +2,24 @@
2 # Description: samba netdata python.d module
3 # Author: Christopher Cox <chris_cox@endlessnow.com>
4 #
5 -# The netdata user needs to be able to be able to sudo the smbstatus program without password
5 +# The netdata user needs to be able to be able to sudo the smbstatus program
6 +# without password:
7 # netdata ALL=(ALL) NOPASSWD: /usr/bin/smbstatus -P
8 #
8 -# This makes calls to smbstatus -P (note smbd needs to be run with the -P 1 option) a lot.
9 +# This makes calls to smbstatus -P
10 #
10 -# Right now this just looks for the smb2_ counters, but adjust the regex to get what you need.
11 +# This just looks at a couple of values out of syscall, and some from smb2.
12 #
12 -# The first chart makes a bad assumption that somehow readout/readin and writeout/writein
13 -# have something to do with actual reads and writes. While it seems to be mostly true for reads,
14 -# I am not sure what the write values are. Perhaps they shouldn't be paired?
15 -#
16 -# create and close are paired, maybe they shouldn't be?
17 -#
18 -# getinfo and setinfo are paired, maybe they shouldn't be?
19 -#
20 -# The Other Smb2 chart is merely a display of current counter values. They didn't seem to change
21 -# much to me. However, if you notice something changing a lot there, bring one or more out into its own
22 -# chart and make it incremental (like find and notify... good examples).
23 -
13 +# The Lesser Ops chart is merely a display of current counter values. They
14 +# didn't seem to change much to me. However, if you notice something changing
15 +# a lot there, bring one or more out into its own chart and make it incremental
16 +# (like find and notify... good examples).
17
18 from base import ExecutableService
19 from re import compile
20
21 # default module values (can be overridden per job in `config`)
29 -# update_every = 2
22 +update_every = 5
23 priority = 60000
24 retries = 60
25
@@ -38,7 +31,7 @@ CHARTS = {
31 ['syscall_sendfile_bytes', 'sendfile', 'incremental', 1, 1024],
32 ['syscall_recvfile_bytes', 'recvfile', 'incremental', -1, 1024]
33 ],
41 - 'options': [None, 'R/Ws', 'kilobytes/s', 'Smb2', 'smb2.readwrite', 'area']
34 + 'options': [None, 'R/Ws', 'kilobytes/s', 'syscall', 'syscall.rw', 'area']
35 },
36 'smb2_rw': {
37 'lines': [
@@ -47,33 +40,33 @@ CHARTS = {
40 ['smb2_read_inbytes', 'readin', 'incremental', 1, 1024],
41 ['smb2_write_outbytes', 'writeout', 'incremental', -1, 1024]
42 ],
50 - 'options': [None, 'R/Ws', 'kilobytes/s', 'Smb2', 'smb2.readwrite', 'area']
43 + 'options': [None, 'R/Ws', 'kilobytes/s', 'smb2', 'smb2.rw', 'area']
44 },
45 'smb2_create_close': {
46 'lines': [
47 ['smb2_create_count', 'create', 'incremental', 1, 1],
48 ['smb2_close_count', 'close', 'incremental', -1, 1]
49 ],
57 - 'options': [None, 'Create/Close', 'operations/s', 'Smb2', 'smb2.create_close', 'line']
50 + 'options': [None, 'Create/Close', 'operations/s', 'smb2', 'smb2.create_close', 'line']
51 },
52 'smb2_info': {
53 'lines': [
54 ['smb2_getinfo_count', 'getinfo', 'incremental', 1, 1],
55 ['smb2_setinfo_count', 'setinfo', 'incremental', -1, 1]
56 ],
64 - 'options': [None, 'Info', 'operations/s', 'Smb2', 'smb2.get_set_info', 'line']
57 + 'options': [None, 'Info', 'operations/s', 'smb2', 'smb2.get_set_info', 'line']
58 },
59 'smb2_find': {
60 'lines': [
61 ['smb2_find_count', 'find', 'incremental', 1, 1]
62 ],
70 - 'options': [None, 'Find', 'operations/s', 'Smb2', 'smb2.find', 'line']
63 + 'options': [None, 'Find', 'operations/s', 'smb2', 'smb2.find', 'line']
64 },
65 'smb2_notify': {
66 'lines': [
67 ['smb2_notify_count', 'notify', 'incremental', 1, 1]
68 ],
76 - 'options': [None, 'Notify', 'operations/s', 'Smb2', 'smb2.notify', 'line']
69 + 'options': [None, 'Notify', 'operations/s', 'smb2', 'smb2.notify', 'line']
70 },
71 'smb2_sm_count': {
72 'lines': [
@@ -88,7 +81,7 @@ CHARTS = {
81 ['smb2_break_count', 'break', 'absolute', 1, 1],
82 ['smb2_sessetup_count', 'sessetup', 'absolute', 1, 1]
83 ],
91 - 'options': [None, 'Lesser Ops', 'count', 'Other Smb2', 'smb2.sm_counters', 'stacked']
84 + 'options': [None, 'Lesser Ops', 'count', 'smb2', 'smb2.sm_counters', 'stacked']
85 }
86 }
87
@@ -123,5 +116,3 @@ class Service(ExecutableService):
116 parsed = self.rgx_smb2.findall(' '.join(raw_data))
117
118 return dict(parsed) or None
126 -
127 -