Skip to content

Commit a190f3c

Browse files
committed
fibre_channel: update procfs to take into account optional attributes
Signed-off-by: machine424 <[email protected]>
1 parent 95efb86 commit a190f3c

File tree

4 files changed

+113
-12
lines changed

4 files changed

+113
-12
lines changed

collector/fibrechannel_linux.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,6 @@ func NewFibreChannelCollector(logger log.Logger) (Collector, error) {
6666
"rx_words_total": "Number of words received by host port",
6767
"tx_frames_total": "Number of frames transmitted by host port",
6868
"link_failure_total": "Number of times the host port link has failed",
69-
"name": "Name of Fibre Channel HBA",
70-
"speed": "Current operating speed",
71-
"port_state": "Current port state",
72-
"port_type": "Port type, what the port is connected to",
73-
"symbolic_name": "Symbolic Name",
74-
"node_name": "Node Name as hexadecimal string",
75-
"port_id": "Port ID as string",
76-
"port_name": "Port Name as hexadecimal string",
77-
"fabric_name": "Fabric Name; 0 if PTP",
78-
"dev_loss_tmo": "Device Loss Timeout in seconds",
79-
"supported_classes": "The FC classes supported",
80-
"supported_speeds": "The FC speeds supported",
8169
}
8270

8371
i.metricDescs = make(map[string]*prometheus.Desc)

collector/fixtures/e2e-64k-page-output.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,48 +742,64 @@ node_entropy_available_bits 1337
742742
node_entropy_pool_size_bits 4096
743743
# HELP node_exporter_build_info A metric with a constant '1' value labeled by version, revision, branch, goversion from which node_exporter was built, and the goos and goarch for the build.
744744
# TYPE node_exporter_build_info gauge
745+
# HELP node_fibrechannel_dumped_frames_total Number of dumped frames
746+
# TYPE node_fibrechannel_dumped_frames_total counter
747+
node_fibrechannel_dumped_frames_total{fc_host="host1"} 0
745748
# HELP node_fibrechannel_error_frames_total Number of errors in frames
746749
# TYPE node_fibrechannel_error_frames_total counter
747750
node_fibrechannel_error_frames_total{fc_host="host0"} 0
751+
node_fibrechannel_error_frames_total{fc_host="host1"} 19
748752
# HELP node_fibrechannel_fcp_packet_aborts_total Number of aborted packets
749753
# TYPE node_fibrechannel_fcp_packet_aborts_total counter
750754
node_fibrechannel_fcp_packet_aborts_total{fc_host="host0"} 19
751755
# HELP node_fibrechannel_info Non-numeric data from /sys/class/fc_host/<host>, value is always 1.
752756
# TYPE node_fibrechannel_info gauge
757+
node_fibrechannel_info{dev_loss_tmo="",fabric_name="",fc_host="host1",port_id="",port_name="",port_state="",port_type="",speed="8 Gbit",supported_classes="",supported_speeds="",symbolic_name=""} 1
753758
node_fibrechannel_info{dev_loss_tmo="30",fabric_name="0",fc_host="host0",port_id="000002",port_name="1000e0071bce95f2",port_state="Online",port_type="Point-To-Point (direct nport connection)",speed="16 Gbit",supported_classes="Class 3",supported_speeds="4 Gbit, 8 Gbit, 16 Gbit",symbolic_name="Emulex SN1100E2P FV12.4.270.3 DV12.4.0.0. HN:gotest. OS:Linux"} 1
754759
# HELP node_fibrechannel_invalid_crc_total Invalid Cyclic Redundancy Check count
755760
# TYPE node_fibrechannel_invalid_crc_total counter
756761
node_fibrechannel_invalid_crc_total{fc_host="host0"} 2
762+
node_fibrechannel_invalid_crc_total{fc_host="host1"} 32
757763
# HELP node_fibrechannel_invalid_tx_words_total Number of invalid words transmitted by host port
758764
# TYPE node_fibrechannel_invalid_tx_words_total counter
759765
node_fibrechannel_invalid_tx_words_total{fc_host="host0"} 8
766+
node_fibrechannel_invalid_tx_words_total{fc_host="host1"} 128
760767
# HELP node_fibrechannel_link_failure_total Number of times the host port link has failed
761768
# TYPE node_fibrechannel_link_failure_total counter
762769
node_fibrechannel_link_failure_total{fc_host="host0"} 9
770+
node_fibrechannel_link_failure_total{fc_host="host1"} 144
763771
# HELP node_fibrechannel_loss_of_signal_total Number of times signal has been lost
764772
# TYPE node_fibrechannel_loss_of_signal_total counter
765773
node_fibrechannel_loss_of_signal_total{fc_host="host0"} 17
774+
node_fibrechannel_loss_of_signal_total{fc_host="host1"} 272
766775
# HELP node_fibrechannel_loss_of_sync_total Number of failures on either bit or transmission word boundaries
767776
# TYPE node_fibrechannel_loss_of_sync_total counter
768777
node_fibrechannel_loss_of_sync_total{fc_host="host0"} 16
778+
node_fibrechannel_loss_of_sync_total{fc_host="host1"} 256
769779
# HELP node_fibrechannel_nos_total Number Not_Operational Primitive Sequence received by host port
770780
# TYPE node_fibrechannel_nos_total counter
771781
node_fibrechannel_nos_total{fc_host="host0"} 18
782+
node_fibrechannel_nos_total{fc_host="host1"} 288
772783
# HELP node_fibrechannel_rx_frames_total Number of frames received
773784
# TYPE node_fibrechannel_rx_frames_total counter
774785
node_fibrechannel_rx_frames_total{fc_host="host0"} 3
786+
node_fibrechannel_rx_frames_total{fc_host="host1"} 48
775787
# HELP node_fibrechannel_rx_words_total Number of words received by host port
776788
# TYPE node_fibrechannel_rx_words_total counter
777789
node_fibrechannel_rx_words_total{fc_host="host0"} 4
790+
node_fibrechannel_rx_words_total{fc_host="host1"} 64
778791
# HELP node_fibrechannel_seconds_since_last_reset_total Number of seconds since last host port reset
779792
# TYPE node_fibrechannel_seconds_since_last_reset_total counter
780793
node_fibrechannel_seconds_since_last_reset_total{fc_host="host0"} 7
794+
node_fibrechannel_seconds_since_last_reset_total{fc_host="host1"} 112
781795
# HELP node_fibrechannel_tx_frames_total Number of frames transmitted by host port
782796
# TYPE node_fibrechannel_tx_frames_total counter
783797
node_fibrechannel_tx_frames_total{fc_host="host0"} 5
798+
node_fibrechannel_tx_frames_total{fc_host="host1"} 80
784799
# HELP node_fibrechannel_tx_words_total Number of words transmitted by host port
785800
# TYPE node_fibrechannel_tx_words_total counter
786801
node_fibrechannel_tx_words_total{fc_host="host0"} 6
802+
node_fibrechannel_tx_words_total{fc_host="host1"} 96
787803
# HELP node_filefd_allocated File descriptor statistics: allocated.
788804
# TYPE node_filefd_allocated gauge
789805
node_filefd_allocated 1024

collector/fixtures/e2e-output.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,48 +764,64 @@ node_entropy_available_bits 1337
764764
node_entropy_pool_size_bits 4096
765765
# HELP node_exporter_build_info A metric with a constant '1' value labeled by version, revision, branch, goversion from which node_exporter was built, and the goos and goarch for the build.
766766
# TYPE node_exporter_build_info gauge
767+
# HELP node_fibrechannel_dumped_frames_total Number of dumped frames
768+
# TYPE node_fibrechannel_dumped_frames_total counter
769+
node_fibrechannel_dumped_frames_total{fc_host="host1"} 0
767770
# HELP node_fibrechannel_error_frames_total Number of errors in frames
768771
# TYPE node_fibrechannel_error_frames_total counter
769772
node_fibrechannel_error_frames_total{fc_host="host0"} 0
773+
node_fibrechannel_error_frames_total{fc_host="host1"} 19
770774
# HELP node_fibrechannel_fcp_packet_aborts_total Number of aborted packets
771775
# TYPE node_fibrechannel_fcp_packet_aborts_total counter
772776
node_fibrechannel_fcp_packet_aborts_total{fc_host="host0"} 19
773777
# HELP node_fibrechannel_info Non-numeric data from /sys/class/fc_host/<host>, value is always 1.
774778
# TYPE node_fibrechannel_info gauge
779+
node_fibrechannel_info{dev_loss_tmo="",fabric_name="",fc_host="host1",port_id="",port_name="",port_state="",port_type="",speed="8 Gbit",supported_classes="",supported_speeds="",symbolic_name=""} 1
775780
node_fibrechannel_info{dev_loss_tmo="30",fabric_name="0",fc_host="host0",port_id="000002",port_name="1000e0071bce95f2",port_state="Online",port_type="Point-To-Point (direct nport connection)",speed="16 Gbit",supported_classes="Class 3",supported_speeds="4 Gbit, 8 Gbit, 16 Gbit",symbolic_name="Emulex SN1100E2P FV12.4.270.3 DV12.4.0.0. HN:gotest. OS:Linux"} 1
776781
# HELP node_fibrechannel_invalid_crc_total Invalid Cyclic Redundancy Check count
777782
# TYPE node_fibrechannel_invalid_crc_total counter
778783
node_fibrechannel_invalid_crc_total{fc_host="host0"} 2
784+
node_fibrechannel_invalid_crc_total{fc_host="host1"} 32
779785
# HELP node_fibrechannel_invalid_tx_words_total Number of invalid words transmitted by host port
780786
# TYPE node_fibrechannel_invalid_tx_words_total counter
781787
node_fibrechannel_invalid_tx_words_total{fc_host="host0"} 8
788+
node_fibrechannel_invalid_tx_words_total{fc_host="host1"} 128
782789
# HELP node_fibrechannel_link_failure_total Number of times the host port link has failed
783790
# TYPE node_fibrechannel_link_failure_total counter
784791
node_fibrechannel_link_failure_total{fc_host="host0"} 9
792+
node_fibrechannel_link_failure_total{fc_host="host1"} 144
785793
# HELP node_fibrechannel_loss_of_signal_total Number of times signal has been lost
786794
# TYPE node_fibrechannel_loss_of_signal_total counter
787795
node_fibrechannel_loss_of_signal_total{fc_host="host0"} 17
796+
node_fibrechannel_loss_of_signal_total{fc_host="host1"} 272
788797
# HELP node_fibrechannel_loss_of_sync_total Number of failures on either bit or transmission word boundaries
789798
# TYPE node_fibrechannel_loss_of_sync_total counter
790799
node_fibrechannel_loss_of_sync_total{fc_host="host0"} 16
800+
node_fibrechannel_loss_of_sync_total{fc_host="host1"} 256
791801
# HELP node_fibrechannel_nos_total Number Not_Operational Primitive Sequence received by host port
792802
# TYPE node_fibrechannel_nos_total counter
793803
node_fibrechannel_nos_total{fc_host="host0"} 18
804+
node_fibrechannel_nos_total{fc_host="host1"} 288
794805
# HELP node_fibrechannel_rx_frames_total Number of frames received
795806
# TYPE node_fibrechannel_rx_frames_total counter
796807
node_fibrechannel_rx_frames_total{fc_host="host0"} 3
808+
node_fibrechannel_rx_frames_total{fc_host="host1"} 48
797809
# HELP node_fibrechannel_rx_words_total Number of words received by host port
798810
# TYPE node_fibrechannel_rx_words_total counter
799811
node_fibrechannel_rx_words_total{fc_host="host0"} 4
812+
node_fibrechannel_rx_words_total{fc_host="host1"} 64
800813
# HELP node_fibrechannel_seconds_since_last_reset_total Number of seconds since last host port reset
801814
# TYPE node_fibrechannel_seconds_since_last_reset_total counter
802815
node_fibrechannel_seconds_since_last_reset_total{fc_host="host0"} 7
816+
node_fibrechannel_seconds_since_last_reset_total{fc_host="host1"} 112
803817
# HELP node_fibrechannel_tx_frames_total Number of frames transmitted by host port
804818
# TYPE node_fibrechannel_tx_frames_total counter
805819
node_fibrechannel_tx_frames_total{fc_host="host0"} 5
820+
node_fibrechannel_tx_frames_total{fc_host="host1"} 80
806821
# HELP node_fibrechannel_tx_words_total Number of words transmitted by host port
807822
# TYPE node_fibrechannel_tx_words_total counter
808823
node_fibrechannel_tx_words_total{fc_host="host0"} 6
824+
node_fibrechannel_tx_words_total{fc_host="host1"} 96
809825
# HELP node_filefd_allocated File descriptor statistics: allocated.
810826
# TYPE node_filefd_allocated gauge
811827
node_filefd_allocated 1024

collector/fixtures/sys.ttar

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,87 @@ Lines: 1
288288
Emulex SN1100E2P FV12.4.270.3 DV12.4.0.0. HN:gotest. OS:Linux
289289
Mode: 644
290290
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
291+
Directory: sys/class/fc_host/host1
292+
Mode: 755
293+
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
294+
Path: sys/class/fc_host/host1/speed
295+
Lines: 1
296+
8 Gbit
297+
Mode: 644
298+
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
299+
Directory: sys/class/fc_host/host1/statistics
300+
Mode: 755
301+
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
302+
Path: sys/class/fc_host/host1/statistics/dumped_frames
303+
Lines: 1
304+
0x0
305+
Mode: 644
306+
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
307+
Path: sys/class/fc_host/host1/statistics/error_frames
308+
Lines: 1
309+
0x13
310+
Mode: 644
311+
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
312+
Path: sys/class/fc_host/host1/statistics/fcp_packet_aborts
313+
Lines: 1
314+
0xffffffffffffffff
315+
Mode: 644
316+
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
317+
Path: sys/class/fc_host/host1/statistics/invalid_crc_count
318+
Lines: 1
319+
0x20
320+
Mode: 644
321+
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
322+
Path: sys/class/fc_host/host1/statistics/invalid_tx_word_count
323+
Lines: 1
324+
0x80
325+
Mode: 644
326+
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
327+
Path: sys/class/fc_host/host1/statistics/link_failure_count
328+
Lines: 1
329+
0x90
330+
Mode: 644
331+
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
332+
Path: sys/class/fc_host/host1/statistics/loss_of_signal_count
333+
Lines: 1
334+
0x110
335+
Mode: 644
336+
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
337+
Path: sys/class/fc_host/host1/statistics/loss_of_sync_count
338+
Lines: 1
339+
0x100
340+
Mode: 644
341+
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
342+
Path: sys/class/fc_host/host1/statistics/nos_count
343+
Lines: 1
344+
0x120
345+
Mode: 644
346+
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
347+
Path: sys/class/fc_host/host1/statistics/rx_frames
348+
Lines: 1
349+
0x30
350+
Mode: 644
351+
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
352+
Path: sys/class/fc_host/host1/statistics/rx_words
353+
Lines: 1
354+
0x40
355+
Mode: 644
356+
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
357+
Path: sys/class/fc_host/host1/statistics/seconds_since_last_reset
358+
Lines: 1
359+
0x70
360+
Mode: 644
361+
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
362+
Path: sys/class/fc_host/host1/statistics/tx_frames
363+
Lines: 1
364+
0x50
365+
Mode: 644
366+
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
367+
Path: sys/class/fc_host/host1/statistics/tx_words
368+
Lines: 1
369+
0x60
370+
Mode: 644
371+
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
291372
Directory: sys/class/hwmon
292373
Mode: 755
293374
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

0 commit comments

Comments
 (0)