Page 2 of 2

Re: Check_smb_status.sh Plugin

Posted: Wed Aug 03, 2016 6:18 pm
by Berto
I have uploaded the screenshot and when navigating to "/usr/local/nagios/share/perfdata/<hostname>/", I don't see any of the mentioned files.

--Berto

Re: Check_smb_status.sh Plugin

Posted: Thu Aug 04, 2016 12:07 am
by Box293
You have two problems:

1)
On your screenshot there is nothing in the "Performance Data" field, this is why you are not getting graphs.
Berto wrote:If I do it from the nagios server to the host from command line it does display back;

Code: Select all

[lnsvr0370]:(584/0)-$ ssh abeltr01@susvr0215 /opt/nagios/libexec/check_smb_status.sh
Total Users/Process:     110 Total Machines:     108 Total Files:     715
That example output does not have any performance data, performance data is everything after the pipe symbol | .

Here is an example of me executing it on a remote CentOS system:
ssh nagios@centos01 /usr/local/nagios/libexec/check_smb_status_original.sh
Total Users/Process:0 Total Machines:0 Total Files:0 |Total Users/Process=0 Total Machines=0 Total Files=0

You can see the highlighted information is the performance data.

Based on your screenshot, this is a Solaris server. I know some commands in Solaris work differently so I suspect you are going to need to spend some time with the commands in the script to see if they are outputting the correct information.

2)
The performance data output by the plugin (from my tests) is not correctly formatted.
|Total Users/Process=0 Total Machines=0 Total Files=0
The datasources have spaces, hence they need to be enclosed in single quotes, like:

|'Total Users/Process'=0 'Total Machines'=0 'Total Files'=0

I think line 87 of the plugin should be:

Code: Select all

echo "Total Users/Process:$total_usersProcess Total Machines:$total_machines Total Files:$total_files  |'Total Users/Process'=$total_usersProcess 'Total Machines'=$total_machines 'Total Files'=$total_files"
https://nagios-plugins.org/doc/guidelines.html#AEN200

Re: Check_smb_status.sh Plugin

Posted: Tue Aug 09, 2016 8:14 am
by Berto
The graph is now working, thanks a lot! This can be closed.

--Berto