Nagios Plugs output does not match in Nagios console
Posted: Thu Jun 30, 2016 3:16 am
Hi,
I created the Nagios plugins to get custom df output but when it passed the output back to Nagios server. It replaced ";" with ":" in the result. This is very puzzle me. I will appreciate for any hints.
Script output:
if [ $STATE_CRITICAL -eq 1 ]
then
echo "CRITICAL - $getStorageInfo;"
exit 2
elif [ $STATE_WARNING -eq 1 ]
then
echo "WARNING - $getStorageInfo;"
exit 1
elif [ $STATE_OK -eq 1 ]
then
echo "OK - $getStorageInfo;"
exit 0
.....
The result is dsplay in one single line.
./check_storage_new -w 80 -c 90
OK - Filesystem;Type;1K-blocks;Used;Available;Use%;Mounted;on;/dev/md1;ext4;113251888;7606716;99892296;8%;/;tmpfs;tmpfs;132211444;0;132211444;0%;/dev/shm;/dev/md2;ext4;2063120;64340;1893980;4%;/boot;/dev/sda;xfs;1170326196;9887460;1160438736;1%;/data/disk1;/dev/sdb;xfs;1170326196;8843992;1161482204;1%;/data/disk2;/dev/sdc;xfs;1170326196;7970756;1162355440;1%;/data/disk3;/dev/sdd;xfs;1170326196;8613564;1161712632;1%;/data/disk4;172.16.1.29:/usr/local/nagios/libexec;nfs;94439424;21877760;67764224;25%;/usr/lib64/nagios/plugins
Nagios Console result: (Somehow ; is replace by ":")
./check_storage_new -w 80 -c 90
OK - Filesystem:Type:1K-blocks:Used:Available:Use%:Mounted
/dev/md1:ext4:113251888:7606912:99892100:8%:/:tmpfs:tmpfs:132211444:0:132211444:0%:/dev/shm:/dev/md2:ext4:2063120:64340:1893980:4%:/boot:/dev/sda:xfs:1170326196:9887460:1160438736:1%:/data/disk1:/dev/sdb:xfs:1170326196:8843992:1161482204:1%:/data/disk2:/dev/sdc:xfs:1170326196:7970756:1162355440:1%:/data/disk3:/dev/sdd:xfs:1170326196:8613564:1161712632:1%:/data/disk4:172.16.1.29:/usr/local/nagios/libexec:nfs:94439424:21878784:67764224:25%:/usr/lib64/nagios/plugins:
Thank you in advance,
-JC
I created the Nagios plugins to get custom df output but when it passed the output back to Nagios server. It replaced ";" with ":" in the result. This is very puzzle me. I will appreciate for any hints.
Script output:
if [ $STATE_CRITICAL -eq 1 ]
then
echo "CRITICAL - $getStorageInfo;"
exit 2
elif [ $STATE_WARNING -eq 1 ]
then
echo "WARNING - $getStorageInfo;"
exit 1
elif [ $STATE_OK -eq 1 ]
then
echo "OK - $getStorageInfo;"
exit 0
.....
The result is dsplay in one single line.
./check_storage_new -w 80 -c 90
OK - Filesystem;Type;1K-blocks;Used;Available;Use%;Mounted;on;/dev/md1;ext4;113251888;7606716;99892296;8%;/;tmpfs;tmpfs;132211444;0;132211444;0%;/dev/shm;/dev/md2;ext4;2063120;64340;1893980;4%;/boot;/dev/sda;xfs;1170326196;9887460;1160438736;1%;/data/disk1;/dev/sdb;xfs;1170326196;8843992;1161482204;1%;/data/disk2;/dev/sdc;xfs;1170326196;7970756;1162355440;1%;/data/disk3;/dev/sdd;xfs;1170326196;8613564;1161712632;1%;/data/disk4;172.16.1.29:/usr/local/nagios/libexec;nfs;94439424;21877760;67764224;25%;/usr/lib64/nagios/plugins
Nagios Console result: (Somehow ; is replace by ":")
./check_storage_new -w 80 -c 90
OK - Filesystem:Type:1K-blocks:Used:Available:Use%:Mounted
Thank you in advance,
-JC