It's time now to start working to our first Nagios plugin, and it does not really matter what we are going check here, since what we are interested in is how to deal with the exchange between Nagios and the plugin, more than how and what we are going to monitor. Once we are done with the script, we will be able to reuse its framework to create whatever script we want, so let's start.
Our project involves checking the status of the local disk using the Self-Monitoring, Analysis, and Reporting Technology (S.M.A.R.T.), which we can think of as a system embedded in most hard disks and solid state disks, whose task is to anticipate and prevent issues and failures. So, a plugin able to query the S.M.A.R.T. system can be used to trap some forthcoming failures, notify the user, and even take advantage of the response mechanism in Nagios to trigger some...