Home Directory Addons Active Checks check_smb_usedspace

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_smb_usedspace

Rating
0 votes
Favoured:
0
Current Version
0.03
Last Release Date
2014-04-04
Compatible With
  • Nagios 3.x
  • Nagios 4.x
  • Nagios XI
Owner
Hits
23636
Files:
FileDescription
check_smb_usedspacePlugin for GNU/Linux 32-bit server
check_smb_usedspace_x64Plugin for GNU/Linux 64-bit server
main.cppMain source file (C++)
gengetopt.ggoGengetopt source file
cmdline.cGengetopt generated file
cmdline.hGengetopt generated file
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
This very simple plugin is writen in C++. The goal is to retrieve the used space on a samba share. check_smb_share is not ok for me because we need authorized access to all directories. We need the used space and not the free space because we pay about the GB and the disk size is not always the same.
This is the very very very first draft of a function which I didn't find on Nagios Exchange. I publish it with the GPL v3 license. You are very encouraged to help me to improve this plugin.


Doc for user :

You need first :
- package to mount cifs/smb share (on Debian, this is cifs-utils)
- Install sudo and config sudoers conf file to give to nagios user the right to mount a cifs/smb share, umount a share, and to change PASSWD variable.
My /etc/sudoers file :
----------
Defaults env_reset
Defaults env_keep += "PASSWD"
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local bin:/usr/sbin:/usr/bin:/sbin:/bin"

Cmnd_Alias MOUNTCIFS = /sbin/mount.cifs, /bin/umount

root ALL=(ALL:ALL) ALL
nagios ALL = NOPASSWD: MOUNTCIFS
%sudo ALL=(ALL:ALL) ALL

#includedir /etc/sudoers.d
----------

- Use check_smb_usedspace --help to obtain the command syntax. Don't forget to multiply by 4 backslash characters.



Developpers doc :
To just modify the main.cpp source file :
- Place main.cpp, cmdline.c and cmdline.h in a directory.
- Edit what you want in the file.
- My simple command to compile is #g++ main.cpp cmdline.c cmdline.h -o check_smb_usedspace
You juste need Gcc/G++ compiler and C/C++ standard libraries.

To modify the --help interface, or options to put in the command line :
- Place main.cpp and gengetopt.ggo in a directory.
- Edit the gengetopt file (doc : https://www.gnu.org/software/gengetopt/ )
- Install Gengetopt and use this command : "gengetopt < gengetopt.ggo"
- My simple command to compile is "g++ main.cpp cmdline.c cmdline.h -o check_smb_usedspace"
You juste need Gcc/G++ compiler and C/C++ standard libraries.


I will very happy if you report me bugs, patchs, suggestions, or if you give me your opinion.