Adding CDATA to Unix agents

This commit is contained in:
fermin831 2015-07-07 12:43:34 +02:00
parent da773b98a1
commit 310c7c45d9
7 changed files with 25 additions and 25 deletions

View File

@ -40,15 +40,15 @@ echo $CURRENT > $DIRETMP
echo "<module>
<name><![CDATA[FS_$DIRE]]></name>
<description>Number of files in directory</description>
<type>generic_proc</type>
<data>$DISPARA</data>
<description><![CDATA[Number of files in directory]]></description>
<type><![CDATA[generic_proc]]></type>
<data><![CDATA[$DISPARA]]></data>
</module>
<module>
<name><![CDATA[NumFiles_FS_$DIRE]]></name>
<description>Number of files</description>
<type>generic_data</type>
<data>$CURRENT</data>
<description><![CDATA[Number of files]]></description>
<type><![CDATA[generic_data]]></type>
<data><![CDATA[$CURRENT]]></data>
</module>"

View File

@ -61,9 +61,9 @@ if ($command ne ""){
}
print "<module>";
print "<name>".$module_name."</name>\n";
print "<type>generic_proc</type>\n";
print "<data>".$module_data."</data>\n";
print "<name><![CDATA[".$module_name."]]></name>\n";
print "<type><![CDATA[generic_proc]]></type>\n";
print "<data><![CDATA[".$module_data."]]></data>\n";
print "<description><![CDATA[" . $module_description . "]]></description>\n";
print "</module>\n";

View File

@ -78,7 +78,7 @@ while (my ($filesystem, $use) = each (%filesystems)) {
print "<name><![CDATA[" . $filesystem . "]]></name>\n";
print "<type><![CDATA[generic_data]]></type>\n";
print "<data><![CDATA[" . $use . "]]></data>\n";
print "<description>% of usage in this volume</description>\n";
print "<description><![CDATA[% of usage in this volume]]></description>\n";
print "</module>\n";
}

View File

@ -67,12 +67,12 @@ while (my ($filesystem, $use) = each (%filesystems)) {
print "<name><![CDATA[Disk_" . $filesystem . "]]></name>\n";
print "<type><![CDATA[generic_data]]></type>\n";
print "<data><![CDATA[" . $free . "]]></data>\n";
print "<min_critical>0</min_critical>\n";
print "<unit>%</unit>\n";
print "<max_critical>5</max_critical>\n";
print "<min_warning>5</min_warning>\n";
print "<max_warning>10</max_warning>\n";
print "<description>% of free space in this volume</description>\n";
print "<min_critical><![CDATA[0]]></min_critical>\n";
print "<unit><![CDATA[%]]></unit>\n";
print "<max_critical><![CDATA[5]]></max_critical>\n";
print "<min_warning><![CDATA[5]]></min_warning>\n";
print "<max_warning><![CDATA[10]]></max_warning>\n";
print "<description><![CDATA[% of free space in this volume]]></description>\n";
print "</module>\n";
}

View File

@ -5,10 +5,10 @@ IN=`netstat -as | grep "InOctets" | awk '{ print $2 }'`
TOTAL=`expr $OUT + $IN`
echo "<module>"
echo " <name>Network_Usage_Bytes</name>"
echo " <type>generic_data_inc</type>"
echo " <data>$TOTAL</data>"
echo " <unit>bytes/sec</unit>"
echo " <description>Total bytes/sec transfered in this system</description>"
echo " <name><![CDATA[Network_Usage_Bytes]]></name>"
echo " <type><![CDATA[generic_data_inc]]></type>"
echo " <data><![CDATA[$TOTAL]]></data>"
echo " <unit><![CDATA[bytes/sec]]></unit>"
echo " <description><![CDATA[Total bytes/sec transfered in this system]]></description>"
echo "</module>"

View File

@ -1,6 +1,6 @@
echo "<module>";
echo "<name>top</name>";
echo "<type>generic_data_string</type>";
echo "<name><![CDATA[top]]></name>";
echo "<type><![CDATA[generic_data_string]]></type>";
echo "<data><![CDATA["
top -b -n 1
echo "]]></data>"

View File

@ -1,7 +1,7 @@
#!/bin/sh
echo "<module>";
echo "<name>who</name>";
echo "<type>async_string</type>";
echo "<name><![CDATA[who]]></name>";
echo "<type><![CDATA[async_string]]></type>";
echo "<data><![CDATA["
WHO=`who`
if [ "$WHO" = "" ]; then