I’ve downloaded the script from nagiosexchange and it refuses to give me an output error code (I’m wrong, there is errorcode output, just “no output” in the status information in nagios). It does however report correctly the FILECOUNT, FOLDERSIZE, and WRITEABLE options for the script, if ran by command line.
There must be at least one person using this check successfully, please share. Or perhaps, could someone else try it out, and see if they can get it to cough up some error codes?
When i first tried this script, it worked in the command line as user nagios, but when setup in nagios, I got “no output” for the Status Information. I modified the script so it would print the errorcode and by the command line, it would print 0, 1 or 2 depending on my warning/critical settings, but still, in nagios, I got “no output”.
As a last straw, I recompiled nagios and now I"m getting “(Return code of 13 is out of bounds)” which, is some permission error I think. I’ve checked permissions, and I know it’s actually executing the script, because if I chown to root.root the file, then I get “plugin not found”.
So, since the plugin is executing, it’s something in the script that differ’s from the command line.
Anyone else try to use this plugin please, at least give it a quick try, it’s easy to setup.
checkcommands.cfg
define command{
command_name check_smb_shares
command_line /usr/local/nagios/libexec/check_smb_shares.pl -H $HOSTADDRESS$ -S $ARG1$ -U $ARG2$ -P $ARG3$ -D $ARG4$ -A $ARG5$ -w $ARG6$ -c $ARG7$
services.cfg
define service{
use generic-service ; Name of service template to use
host_name somehost
service_description filecount
check_command check_smb_shares!FILECOUNT!nagios!guest!somedomain!/Vol1/DPS-ADS/Bus_Sys/ASC!5!6
contact_groups PP-Hosts
process_perf_data 0 ; Process performance data
}
I don’t like how I got it working, but this is the best I can come up with. It must have something to do with env.
define service{
use generic-service ; Name of service template to use
host_name somehost
service_description filecount
check_command check_smb_shares
contact_groups PP-Hosts
process_perf_data 0 ; Process performance data
}
I don’t really think it needs superuser rights, but my thinking is that it’s an environment issue. But yea, every command has to be defined. I’m not using this check alot at this point, and won’t until I resolve the env issue.
Have you tried to download the script and try it out?