Good morning
I'm testing Zabbix , and would desaber how do I create a PHP script or Sheel Script ?
Have to put in some folder ? Zabbix has the function to run automatically?
My script
I'm testing Zabbix , and would desaber how do I create a PHP script or Sheel Script ?
Have to put in some folder ? Zabbix has the function to run automatically?
My script
PHP Code:
#!/usr/bin/php
<?php
$used_space=chop(shell_exec("df -h / | grep -v Filesystem | awk '{print $5}'"));
switch ($used_space) {
case "$used_space" < "85%":
print "OK - $used_space of disk space used.";
exit(0);
case "$used_space" == "85%":
print "WARNING - $used_space of disk space used.";
exit(1);
case $used_space > "85%":
print "CRITICAL - $used_space of disk space used.";
exit(2);
default:
print "UNKNOWN - $used_space of disk space used.";
exit(3);
}
?>