Active Checks

check_smb_usedspace

Description:

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.

Current Version

0.03

Last Release Date

2014-04-04

Compatible With

  • Nagios 3.x
  • Nagios 4.x
  • Nagios XI

Project Files
Project Notes
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.
Reviews (0) Add a Review
Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
0 (0)
Favorites
0
Views
23,688