Last night, I began receiving e-mails saying my drive was over 75% full. This morning, I discovered that it sent the notification repeatedly every hour, so I figured it was being done from cron. Checking revealed that, sure enough, /var/lib/asterisk/bin/storage.php was being run hourly from cron. We were in NO danger of running out of drive space as the file system in question had over 40 gig free yet.
Figuring I just had to change a configuration in the GUI, I loaded the System Admin module and went into Notifications. Only thing there was who to send them to. Poking around through the rest of System Admin, then a bunch of other modules did not reveal where to set this parameter. OK, fine - Iâll just change it in the PHP script⌠only itâs been obfuscated.
So my questions are
How do I go about changing the percentage of space that must be consumed before I am e-mailed about it?
Is there any built-in way to say âonly bug the admin once every xx hours about thisâ for notifications?
As it stands, the only thing I can think of to work around the problem is to somehow de-obfuscate the PHP script or simply write my own & disable the built-in mechanism. (The latter would almost certainly be faster, but itâs highly annoying to buy a ready-to-go phone system and then have to start writing pieces to replace what doesnât work or isnât configurable for no real reasonâŚ)
The ârightâ way would be to submit a feature request asking to create a variable in the Settings page somewhere that adjusted that.
Another (even more ridiculous way) would be to set up the Asterisk -> Nagios connection and let Nagios handle it. That way, you can fully manage both without any changes to the underlying Asterisk system.
Still waiting on the last actual bugs I reported to be fixed, so Iâm not going to bother the devs with something so simple, even though itâs kinda crazy to not permit notifications to be configured.
Donât know why, but copy/pasting that crontab entry to the storage.php line resulted in no notifications at all being sent from last Friday up until about 10 minutes ago - then I got the first one. (Hey, at least it shut up & didnât fill up my mailbox all weekend long! )
I didnât care for it only checking between those hours - if something goes haywire & fills the drive, I want to know NOW. So I wrote a script in perl which is how the built-in feature shouldâve been written IMO. It allows for virtually any number of alerts to be defined which are triggered on the percentage of drive space remaining, you can set each alert to notify one or more admins or have all alerts go to a single admin, you can set each alert to notify the admin every n hours, and you can specify which file systems to be monitored. Wrote it in my spare time on Friday & today - just turned it on & am testing now. Once Iâm confident I didnât do anything completely idiotic, Iâll share it so that others may benefit from my work. (Believe it or not, I actually added documentation with the intent of sharing⌠my old coding instructors would be so proud! )
Question: Is it permitted to post a script like this on these forums?
As to posting code, I have had scripts deleted , but that was when other folks were in charge
probably posting with the hash/bang commented might be more acceptable 'cos then it is ânot a scriptâ that can be blindly copy/pasted into a shell but still open for peer review which is always a good thing