Page 1 of 2
Issues with check_iostat
Posted: Mon Jul 17, 2017 2:27 am
by Hauru
Hello everyone.
I am trying to use this plugin :
https://exchange.nagios.org/directory/P ... 1499169198
To check disk iostat with SNMP. But I don't understand why, when I run :
Code: Select all
/usr/local/nagios/libexec/check_diskio_ucd.pl -H X.X.X.X -C community -s 2 -d sdb1 -w 30 -c 50
I have this error :
I have the same issue with sda1,sda2,sda5 ...
I think my SNMP is working on my server because when I try snmpwalk it does work.
this is the result of the command fdisk -l on the server I want to look at :
Code: Select all
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 1169682431 1169680384 557,8G 7 HPFS/NTFS/exFAT
Code: Select all
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 561100799 561098752 267,6G 83 Linux
/dev/sda2 561102846 584841215 23738370 11,3G 5 Extended
/dev/sda5 561102848 584841215 23738368 11,3G 82 Linux swap / Solaris
This is just a sample, I can give you the complete return if needed.
Another question, how can I use this plugin with a windows server ? I tried something like :
Code: Select all
/usr/local/nagios/libexec/check_diskio_ucd.pl -H XXX.XXX.XXX.XXX -C community -s 2 -d C -w 30 -c 50
But I have the same error.
I found the commands on this post :
https://support.nagios.com/forum/viewto ... =7&t=33578
Thank you everyone for your help
Re: Issues with check_iostat
Posted: Mon Jul 17, 2017 8:30 am
by mcapra
Hauru wrote:
I think my SNMP is working on my server because when I try snmpwalk it does work.
Can you share the output of an
snmpwalk against the
1.3.6.1.4.1.2021.13.15.1 tree? Sometimes the UCD-SNMP-MIB module can exclude disks unless they are specifically mentioned in the
snmpd.conf file. I would be curious to see if the
snmpwalk includes disks that match the label provided to the script (as well as the associated counters).
Would you also be able to share a copy of the remote machine's
snmpd.conf file?
Hauru wrote:Another question, how can I use this plugin with a windows server ?
You would probably need to add the UCD-SNMP-MIB module to your Windows server's SNMP environment. I'm not 100% certain how that could be done if it doesn't currently exist.
NSClient++ has some native options for checking Windows performance counters, which should include disk I/O related stats:
https://docs.nsclient.org/howto/counters/
http://sites.box293.com/nagios/guides/c ... s/cpu-load
Re: Issues with check_iostat
Posted: Mon Jul 17, 2017 9:04 am
by Hauru
mcapra wrote:Hauru wrote:
I think my SNMP is working on my server because when I try snmpwalk it does work.
Can you share the output of an
snmpwalk against the
1.3.6.1.4.1.2021.13.15.1 tree? Sometimes the UCD-SNMP-MIB module can exclude disks unless they are specifically mentioned in the
snmpd.conf file. I would be curious to see if the
snmpwalk includes disks that match the label provided to the script (as well as the associated counters).
Well, I have this :
Code: Select all
snmpwalk -v1 X.X.X.X -c public 1.3.6.1.4.1.2021.13.15.1
End of MIB
I thought it was working, but it is not ... When I use this command :
I have something which looks correct, that's why I thought snmpwalk was OK.
mcapra wrote:Would you also be able to share a copy of the remote machine's snmpd.conf file?
Code: Select all
###############################################################################
#
# EXAMPLE.conf:
# An example configuration file for configuring the Net-SNMP agent ('snmpd')
# See the 'snmpd.conf(5)' man page for details
#
# Some entries are deliberately commented out, and will need to be explicitly activated
#
###############################################################################
#
# AGENT BEHAVIOUR
#
# Listen for connections from the local system only
#agentAddress udp:127.0.0.1:161
# Listen for connections on all interfaces (both IPv4 *and* IPv6)
agentAddress udp:161,udp6:[::1]:161
###############################################################################
#
# SNMPv3 AUTHENTICATION
#
# Note that these particular settings don't actually belong here.
# They should be copied to the file /var/lib/snmp/snmpd.conf
# and the passwords changed, before being uncommented in that file *only*.
# Then restart the agent
# createUser authOnlyUser MD5 "remember to change this password"
# createUser authPrivUser SHA "remember to change this one too" DES
# createUser internalUser MD5 "this is only ever used internally, but still change the password"
# If you also change the usernames (which might be sensible),
# then remember to update the other occurances in this example config file to match.
###############################################################################
#
# ACCESS CONTROL
#
# system + hrSystem groups only
view systemonly included .1.3.6.1.2.1.1
view systemonly included .1.3.6.1.2.1.25.1
# Full access from the local host
#rocommunity public localhost
# Default access to basic system info
rocommunity public default -V systemonly
# rocommunity6 is for IPv6
rocommunity6 public default -V systemonly
# Full access from an example network
# Adjust this network address to match your local
# settings, change the community string,
# and check the 'agentAddress' setting above
#rocommunity secret 10.0.0.0/16
# Full read-only access for SNMPv3
rouser authOnlyUser
# Full write access for encrypted requests
# Remember to activate the 'createUser' lines above
#rwuser authPrivUser priv
# It's no longer typically necessary to use the full 'com2sec/group/access' configuration
# r[ow]user and r[ow]community, together with suitable views, should cover most requirements
###############################################################################
#
# SYSTEM INFORMATION
#
# Note that setting these values here, results in the corresponding MIB objects being 'read-only'
# See snmpd.conf(5) for more details
sysLocation Sitting on the Dock of the Bay
sysContact Me <me@example.org>
# Application + End-to-End layers
sysServices 72
#
# Process Monitoring
#
# At least one 'mountd' process
proc mountd
# No more than 4 'ntalkd' processes - 0 is OK
proc ntalkd 4
# At least one 'sendmail' process, but no more than 10
proc sendmail 10 1
# Walk the UCD-SNMP-MIB::prTable to see the resulting output
# Note that this table will be empty if there are no "proc" entries in the snmpd.conf file
#
# Disk Monitoring
#
# 10MBs required on root disk, 5% free on /var, 10% free on all other disks
disk / 10000
disk /var 5%
includeAllDisks 10%
# Walk the UCD-SNMP-MIB::dskTable to see the resulting output
# Note that this table will be empty if there are no "disk" entries in the snmpd.conf file
#
# System Load
#
# Unacceptable 1-, 5-, and 15-minute load averages
load 12 10 5
# Walk the UCD-SNMP-MIB::laTable to see the resulting output
# Note that this table *will* be populated, even without a "load" entry in the snmpd.conf file
###############################################################################
#
# ACTIVE MONITORING
#
# send SNMPv1 traps
trapsink localhost public
# send SNMPv2c traps
#trap2sink localhost public
# send SNMPv2c INFORMs
#informsink localhost public
# Note that you typically only want *one* of these three lines
# Uncommenting two (or all three) will result in multiple copies of each notification.
#
# Event MIB - automatically generate alerts
#
# Remember to activate the 'createUser' lines above
iquerySecName internalUser
rouser internalUser
# generate traps on UCD error conditions
defaultMonitors yes
# generate traps on linkUp/Down
linkUpDownNotifications yes
###############################################################################
#
# EXTENDING THE AGENT
#
#
# Arbitrary extension commands
#
extend test1 /bin/echo Hello, world!
extend-sh test2 echo Hello, world! ; echo Hi there ; exit 35
#extend-sh test3 /bin/sh /tmp/shtest
# Note that this last entry requires the script '/tmp/shtest' to be created first,
# containing the same three shell commands, before the line is uncommented
# Walk the NET-SNMP-EXTEND-MIB tables (nsExtendConfigTable, nsExtendOutput1Table
# and nsExtendOutput2Table) to see the resulting output
# Note that the "extend" directive supercedes the previous "exec" and "sh" directives
# However, walking the UCD-SNMP-MIB::extTable should still returns the same output,
# as well as the fuller results in the above tables.
#
# "Pass-through" MIB extension command
#
#pass .1.3.6.1.4.1.8072.2.255 /bin/sh PREFIX/local/passtest
#pass .1.3.6.1.4.1.8072.2.255 /usr/bin/perl PREFIX/local/passtest.pl
# Note that this requires one of the two 'passtest' scripts to be installed first,
# before the appropriate line is uncommented.
# These scripts can be found in the 'local' directory of the source distribution,
# and are not installed automatically.
# Walk the NET-SNMP-PASS-MIB::netSnmpPassExamples subtree to see the resulting output
#
# AgentX Sub-agents
#
# Run as an AgentX master agent
master agentx
# Listen for network connections (from localhost)
# rather than the default named socket /var/agentx/master
#agentXSocket tcp:localhost:705
About windows, I will take a look at your links, but I prefer use only SNMP if possible
Re: Issues with check_iostat
Posted: Mon Jul 17, 2017 2:28 pm
by tgriep
Can you run the plugin in verbose mode and post the output here so if there are any errors, we can view them?
Code: Select all
/usr/local/nagios/libexec/check_diskio_ucd.pl -H X.X.X.X -C community -s 2 -d sdb1 -w 30 -c 50 --verbose
Re: Issues with check_iostat
Posted: Tue Jul 18, 2017 1:20 am
by Hauru
Hi ! This is what the command returns me :
Code: Select all
Net::SNMP Version: v6.0.1
1st Measurement of DiskIO-Load
Waiting 5 seconds
2nd Measurement of DiskIO-Load
UCD-DISKIO Table - 1st Measurement
======================================
UCD-DISKIO Table - 2nd Measurement
======================================
DISKIO WARN - Disk sdb1 not found
--verbose looks to be an useful command, I didn't know it !
Re: Issues with check_iostat
Posted: Tue Jul 18, 2017 12:21 pm
by tgriep
Well, the verbose output did not show anything.
When you ran the snmpwalk
Code: Select all
snmpwalk -v1 X.X.X.X -c public 1.3.6.1.4.1.2021.13.15.1
and you received this output,
End of MIB
Might be because the MIB file on the Nagios server is corrupted, missing, etc...
UCD-DISKIO-MIB
Take a look in the following folder and see if the file is not corrupted, etc...
The file is usually called UCD-DISKIO-MIB.txt but is there is another similar named file, try removing the other one and see if the snmpwalk functions
Try running
Code: Select all
snmpwalk -v1 X.X.X.X -c public 1.3.6.1.4.1.2021.13.15.1
and
Code: Select all
snmpwalk -v2c X.X.X.X -c public 1.3.6.1.4.1.2021.13.15.1
Also, it looks like that plugin is not compatible with a Windows system.
Re: Issues with check_iostat
Posted: Wed Jul 19, 2017 2:39 am
by Hauru
tgriep wrote:Might be because the MIB file on the Nagios server is corrupted, missing, etc...
UCD-DISKIO-MIB
Take a look in the following folder and see if the file is not corrupted, etc...
The file is here but I think it is a bit short, but I don't know if it is supposed to be a long file.
tgriep wrote:The file is usually called UCD-DISKIO-MIB.txt but is there is another similar named file, try removing the other one and see if the snmpwalk functions
Try running
Code: Select all
snmpwalk -v1 X.X.X.X -c public 1.3.6.1.4.1.2021.13.15.1
and
Code: Select all
snmpwalk -v2c X.X.X.X -c public 1.3.6.1.4.1.2021.13.15.1
Also, it looks like that plugin is not compatible with a Windows system.
I have two files with similar name :
Code: Select all
- UCD-DEMO-MIB.txt
- UCD-DISKIO-MIB.txt
- UCD-DLMOD-MIB.txt
Which one should I remove? I also have these files :
Code: Select all
- UCD-IPFILTER-MIB.txt
- UCD-IPFWACC-MIB.txt
- UCD-SNMP-MIB-OLD.txt
- UCD-SNMP-MIB.txt
But I think they are less similar to UCD-DISKIO-MIB.txt
tgriep wrote:Also, it looks like that plugin is not compatible with a Windows system.
I think too, it looks like I have to use NSClient ++ if I want to have io data on Windows
Re: Issues with check_iostat
Posted: Wed Jul 19, 2017 10:26 am
by tgriep
I think the issue is with one of these files.
Code: Select all
UCD-SNMP-MIB-OLD.txt
UCD-SNMP-MIB.txt
I don't have the UCD-SNMP-MIB-OLD.txt file on my server and that file maybe causing the problem.
Try moving it out of the /usr/share/snmp/mibs/ folder and try the snmpwalk command again to see if it works.
Re: Issues with check_iostat
Posted: Thu Jul 20, 2017 1:51 am
by Hauru
I tried to move the file UCD-SNMP-MID-OLD.txt and then UCD-SNMP-MID.txt, but it doesn't change anything :
Code: Select all
snmpwalk -v1 X.X.X.X -c public 1.3.6.1.4.1.2021.13.15.1
End of MIB
Code: Select all
snmpwalk -v2c X.X.X.X -c public 1.3.6.1.4.1.2021.13.15.1
iso.3.6.1.4.1.2021.13.15.1 = No more variables left in this MIB View (It is past the end of the MIB tree)
Re: Issues with check_iostat
Posted: Thu Jul 20, 2017 10:22 am
by mcapra
I suspect this still holds true for the default Microsoft-provided Windows SNMP agent:
mcapra wrote:
You would probably need to add the UCD-SNMP-MIB module to your Windows server's SNMP environment. I'm not 100% certain how that could be done if it doesn't currently exist.
MIB definitions and
MIB modules are two separate things. Think of the MIB module as the actual software that provides the counters, while the MIB definitions translate those counters into something more human-readable. More on MIB modules:
http://net-snmp.sourceforge.net/tutoria ... index.html
Just having the MIB definitions in-play probably isn't enough if Windows doesn't have the UCD counters to provide. From what I've read, it doesn't look like the generic Windows SNMP agent is providing any of the UCD counters. There exists a Net-SNMP maintained agent for Windows (which is a totally separate SNMP agent from the default Windows one) that likely includes the UC Davis provided modules:
https://sourceforge.net/projects/net-snmp/files/
But at that point, it'd be much less trouble to just install NSClient++ or use WMI with
check_wmi_plus to assess the aforementioned performance counters.