Created
March 22, 2012 19:53
-
-
Save pironic/2162872 to your computer and use it in GitHub Desktop.
cacti plugins
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // put this file on your remote server and then use the url in the script config. | |
| error_reporting(0); | |
| if (ini_get('disable_functions')) { | |
| $disabled_funcs=array_map('trim',explode(',',ini_get('disable_functions'))); | |
| } | |
| $action=$_GET["action"]; | |
| $users[0]="Unavailable"; | |
| $users[1]="--"; | |
| $loadnow="Unavailable"; | |
| $load15="--"; | |
| $load30="--"; | |
| if (in_array('exec',$disabled_funcs)) { | |
| $load=file_get_contents("/proc/loadavg"); | |
| $load=explode(' ',$load); | |
| $loadnow=$load[0]; | |
| $load15=$load[1]; | |
| $load30=$load[2]; | |
| } else { | |
| $reguptime=trim(exec("uptime")); | |
| if ($reguptime) { | |
| if (preg_match("/, *(\d) (users?), .*: (.*), (.*), (.*)/",$reguptime,$uptime)) { | |
| $users[0]=$uptime[1]; | |
| $users[1]=$uptime[2]; | |
| $loadnow=$uptime[3]; | |
| $load15=$uptime[4]; | |
| $load30=$uptime[5]; | |
| } | |
| } | |
| } | |
| if (in_array('shell_exec',$disabled_funcs)) { | |
| $uptime_text=file_get_contents("/proc/uptime"); | |
| $uptime=substr($uptime_text,0,strpos($uptime_text," ")); | |
| } else { | |
| $uptime=shell_exec("cut -d. -f1 /proc/uptime"); | |
| } | |
| $days=floor($uptime/60/60/24); | |
| $hours=str_pad($uptime/60/60%24,2,"0",STR_PAD_LEFT); | |
| $mins=str_pad($uptime/60%60,2,"0",STR_PAD_LEFT); | |
| $secs=str_pad($uptime%60,2,"0",STR_PAD_LEFT); | |
| $phpver=phpversion(); | |
| $mysqlver=mysql_get_client_info(); | |
| $zendver=zend_version(); | |
| echo "name:cerato users:".$users[0]; | |
| //echo " users1:".$users[1]; | |
| echo " load1:".$loadnow; | |
| echo " load5:".$load15; | |
| echo " load15:".$load30; | |
| echo " uptime:\"{$days} Days {$hours}:{$mins}:{$secs}\" "; | |
| echo "\eof"; | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // put this file on your remote server and then use the url in the script config. | |
| error_reporting(0); | |
| if (ini_get('disable_functions')) { | |
| $disabled_funcs=array_map('trim',explode(',',ini_get('disable_functions'))); | |
| } | |
| $action=$_GET["action"]; | |
| $users[0]="Unavailable"; | |
| $users[1]="--"; | |
| $loadnow="Unavailable"; | |
| $load15="--"; | |
| $load30="--"; | |
| if (in_array('exec',$disabled_funcs)) { | |
| $load=file_get_contents("/proc/loadavg"); | |
| $load=explode(' ',$load); | |
| $loadnow=$load[0]; | |
| $load15=$load[1]; | |
| $load30=$load[2]; | |
| } else { | |
| $reguptime=trim(exec("uptime")); | |
| if ($reguptime) { | |
| if (preg_match("/, *(\d) (users?), .*: (.*), (.*), (.*)/",$reguptime,$uptime)) { | |
| $users[0]=$uptime[1]; | |
| $users[1]=$uptime[2]; | |
| $loadnow=$uptime[3]; | |
| $load15=$uptime[4]; | |
| $load30=$uptime[5]; | |
| } | |
| } | |
| } | |
| if (in_array('shell_exec',$disabled_funcs)) { | |
| $uptime_text=file_get_contents("/proc/uptime"); | |
| $uptime=substr($uptime_text,0,strpos($uptime_text," ")); | |
| } else { | |
| $uptime=shell_exec("cut -d. -f1 /proc/uptime"); | |
| } | |
| $days=floor($uptime/60/60/24); | |
| $hours=str_pad($uptime/60/60%24,2,"0",STR_PAD_LEFT); | |
| $mins=str_pad($uptime/60%60,2,"0",STR_PAD_LEFT); | |
| $secs=str_pad($uptime%60,2,"0",STR_PAD_LEFT); | |
| $phpver=phpversion(); | |
| $mysqlver=mysql_get_client_info(); | |
| $zendver=zend_version(); | |
| echo "name:cerato users:".$users[0]; | |
| //echo " users1:".$users[1]; | |
| echo " load1:".$loadnow; | |
| echo " load5:".$load15; | |
| echo " load15:".$load30; | |
| echo " uptime:\"{$days} Days {$hours}:{$mins}:{$secs}\" "; | |
| echo "\eof"; | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <cacti> | |
| <hash_0000231f72a3fe5643fdaf82728fd1054cbaee> | |
| <name>Icecast Listeners</name> | |
| <graph> | |
| <t_title></t_title> | |
| <title>|host_description| - |input_mount| - Current Icecast Listeners</title> | |
| <t_image_format_id></t_image_format_id> | |
| <image_format_id>1</image_format_id> | |
| <t_height></t_height> | |
| <height>120</height> | |
| <t_width></t_width> | |
| <width>500</width> | |
| <t_slope_mode></t_slope_mode> | |
| <slope_mode>on</slope_mode> | |
| <t_auto_scale></t_auto_scale> | |
| <auto_scale>on</auto_scale> | |
| <t_auto_scale_opts></t_auto_scale_opts> | |
| <auto_scale_opts>2</auto_scale_opts> | |
| <t_auto_scale_log></t_auto_scale_log> | |
| <auto_scale_log></auto_scale_log> | |
| <t_scale_log_units></t_scale_log_units> | |
| <scale_log_units></scale_log_units> | |
| <t_auto_scale_rigid></t_auto_scale_rigid> | |
| <auto_scale_rigid></auto_scale_rigid> | |
| <t_auto_padding></t_auto_padding> | |
| <auto_padding>on</auto_padding> | |
| <t_export></t_export> | |
| <export>on</export> | |
| <t_upper_limit></t_upper_limit> | |
| <upper_limit>100</upper_limit> | |
| <t_lower_limit></t_lower_limit> | |
| <lower_limit>0</lower_limit> | |
| <t_base_value></t_base_value> | |
| <base_value>1000</base_value> | |
| <t_unit_value></t_unit_value> | |
| <unit_value></unit_value> | |
| <t_unit_exponent_value></t_unit_exponent_value> | |
| <unit_exponent_value></unit_exponent_value> | |
| <t_vertical_label></t_vertical_label> | |
| <vertical_label>Listener Count</vertical_label> | |
| </graph> | |
| <items> | |
| <hash_1000237f73287dbafc047f62b663e328759208> | |
| <task_item_id>hash_08002317831988b74b45eb023d5da9abe866a3</task_item_id> | |
| <color_id>000000</color_id> | |
| <alpha>FF</alpha> | |
| <graph_type_id>5</graph_type_id> | |
| <consolidation_function_id>1</consolidation_function_id> | |
| <cdef_id>0</cdef_id> | |
| <value></value> | |
| <gprint_id>hash_060023e9c43831e54eca8069317a2ce8c6f751</gprint_id> | |
| <text_format>Average:</text_format> | |
| <hard_return></hard_return> | |
| <sequence>1</sequence> | |
| </hash_1000237f73287dbafc047f62b663e328759208> | |
| <hash_100023a7a87b0677d5942ddd18c182e755a5d9> | |
| <task_item_id>hash_08002317831988b74b45eb023d5da9abe866a3</task_item_id> | |
| <color_id>0</color_id> | |
| <alpha>FF</alpha> | |
| <graph_type_id>9</graph_type_id> | |
| <consolidation_function_id>1</consolidation_function_id> | |
| <cdef_id>0</cdef_id> | |
| <value></value> | |
| <gprint_id>hash_060023e9c43831e54eca8069317a2ce8c6f751</gprint_id> | |
| <text_format>Average:</text_format> | |
| <hard_return></hard_return> | |
| <sequence>2</sequence> | |
| </hash_100023a7a87b0677d5942ddd18c182e755a5d9> | |
| <hash_1000238d949793446df2dc6b2d209850d2e13e> | |
| <task_item_id>hash_08002317831988b74b45eb023d5da9abe866a3</task_item_id> | |
| <color_id>4444FF</color_id> | |
| <alpha>7F</alpha> | |
| <graph_type_id>4</graph_type_id> | |
| <consolidation_function_id>2</consolidation_function_id> | |
| <cdef_id>0</cdef_id> | |
| <value></value> | |
| <gprint_id>hash_060023e9c43831e54eca8069317a2ce8c6f751</gprint_id> | |
| <text_format>Min:</text_format> | |
| <hard_return></hard_return> | |
| <sequence>3</sequence> | |
| </hash_1000238d949793446df2dc6b2d209850d2e13e> | |
| <hash_1000230a1cb1b5e625076b6867d60f37ec59e1> | |
| <task_item_id>hash_08002317831988b74b45eb023d5da9abe866a3</task_item_id> | |
| <color_id>0</color_id> | |
| <alpha>FF</alpha> | |
| <graph_type_id>9</graph_type_id> | |
| <consolidation_function_id>2</consolidation_function_id> | |
| <cdef_id>0</cdef_id> | |
| <value></value> | |
| <gprint_id>hash_060023e9c43831e54eca8069317a2ce8c6f751</gprint_id> | |
| <text_format>Min:</text_format> | |
| <hard_return></hard_return> | |
| <sequence>4</sequence> | |
| </hash_1000230a1cb1b5e625076b6867d60f37ec59e1> | |
| <hash_1000234d987b8b3b6491da5bcbb6cc3250a5a7> | |
| <task_item_id>hash_08002317831988b74b45eb023d5da9abe866a3</task_item_id> | |
| <color_id>FF3932</color_id> | |
| <alpha>7F</alpha> | |
| <graph_type_id>4</graph_type_id> | |
| <consolidation_function_id>3</consolidation_function_id> | |
| <cdef_id>0</cdef_id> | |
| <value></value> | |
| <gprint_id>hash_060023e9c43831e54eca8069317a2ce8c6f751</gprint_id> | |
| <text_format>Max:</text_format> | |
| <hard_return></hard_return> | |
| <sequence>5</sequence> | |
| </hash_1000234d987b8b3b6491da5bcbb6cc3250a5a7> | |
| <hash_100023516552a38e4142c3decc9f0004ff44bb> | |
| <task_item_id>hash_08002317831988b74b45eb023d5da9abe866a3</task_item_id> | |
| <color_id>0</color_id> | |
| <alpha>FF</alpha> | |
| <graph_type_id>9</graph_type_id> | |
| <consolidation_function_id>3</consolidation_function_id> | |
| <cdef_id>0</cdef_id> | |
| <value></value> | |
| <gprint_id>hash_060023e9c43831e54eca8069317a2ce8c6f751</gprint_id> | |
| <text_format>Maximum:</text_format> | |
| <hard_return>on</hard_return> | |
| <sequence>6</sequence> | |
| </hash_100023516552a38e4142c3decc9f0004ff44bb> | |
| </items> | |
| <inputs> | |
| <hash_0900239d8567a1f18b7c8d506c65cea40f76cb> | |
| <name>Data Source [current_listeners]</name> | |
| <description></description> | |
| <column_name>task_item_id</column_name> | |
| <items>hash_0000237f73287dbafc047f62b663e328759208|hash_0000230a1cb1b5e625076b6867d60f37ec59e1|hash_000023a7a87b0677d5942ddd18c182e755a5d9|hash_000023516552a38e4142c3decc9f0004ff44bb|hash_0000238d949793446df2dc6b2d209850d2e13e|hash_0000234d987b8b3b6491da5bcbb6cc3250a5a7</items> | |
| </hash_0900239d8567a1f18b7c8d506c65cea40f76cb> | |
| </inputs> | |
| </hash_0000231f72a3fe5643fdaf82728fd1054cbaee> | |
| <hash_01002398a5f18c366c39f143dc40062c945971> | |
| <name>Icecast - Current Listeners</name> | |
| <ds> | |
| <t_name></t_name> | |
| <name>|host_description| - Current Icecast Listeners</name> | |
| <data_input_id>hash_0300233214ae60d7a96ea3de89662cac24f62a</data_input_id> | |
| <t_rra_id></t_rra_id> | |
| <t_rrd_step></t_rrd_step> | |
| <rrd_step>300</rrd_step> | |
| <t_active></t_active> | |
| <active>on</active> | |
| <rra_items>hash_150023c21df5178e5c955013591239eb0afd46|hash_1500230d9c0af8b8acdc7807943937b3208e29|hash_1500236fc2d038fb42950138b0ce3e9874cc60|hash_150023e36f3adb9f152adfa5dc50fd2b23337e|hash_150023283ea2bf1634d92ce081ec82a634f513</rra_items> | |
| </ds> | |
| <items> | |
| <hash_08002317831988b74b45eb023d5da9abe866a3> | |
| <t_data_source_name></t_data_source_name> | |
| <data_source_name>current_listeners</data_source_name> | |
| <t_rrd_minimum></t_rrd_minimum> | |
| <rrd_minimum>0</rrd_minimum> | |
| <t_rrd_maximum></t_rrd_maximum> | |
| <rrd_maximum>U</rrd_maximum> | |
| <t_data_source_type_id></t_data_source_type_id> | |
| <data_source_type_id>1</data_source_type_id> | |
| <t_rrd_heartbeat></t_rrd_heartbeat> | |
| <rrd_heartbeat>600</rrd_heartbeat> | |
| <t_data_input_field_id></t_data_input_field_id> | |
| <data_input_field_id>hash_070023beebdfe69d8e98e2111c70c98a1829fa</data_input_field_id> | |
| </hash_08002317831988b74b45eb023d5da9abe866a3> | |
| </items> | |
| <data> | |
| <item_000> | |
| <data_input_field_id>hash_0700239e745619d5ae1716147ca788b3d00a53</data_input_field_id> | |
| <t_value>on</t_value> | |
| <value></value> | |
| </item_000> | |
| <item_001> | |
| <data_input_field_id>hash_07002385dbb68d8941d19a4d51a6de025b82d1</data_input_field_id> | |
| <t_value>on</t_value> | |
| <value></value> | |
| </item_001> | |
| <item_002> | |
| <data_input_field_id>hash_070023188eb9cda49083cfe18966e73467d274</data_input_field_id> | |
| <t_value>on</t_value> | |
| <value></value> | |
| </item_002> | |
| <item_003> | |
| <data_input_field_id>hash_07002378a9e256da3b449872f7c31f86d14a41</data_input_field_id> | |
| <t_value>on</t_value> | |
| <value></value> | |
| </item_003> | |
| </data> | |
| </hash_01002398a5f18c366c39f143dc40062c945971> | |
| <hash_0300233214ae60d7a96ea3de89662cac24f62a> | |
| <name>Icecast Stats</name> | |
| <type_id>1</type_id> | |
| <input_string>python <path_cacti>/scripts/icecast.py -x <xml> -m <mount> -u <user> -p <pass></input_string> | |
| <fields> | |
| <hash_0700239e745619d5ae1716147ca788b3d00a53> | |
| <name>Password</name> | |
| <update_rra></update_rra> | |
| <regexp_match></regexp_match> | |
| <allow_nulls></allow_nulls> | |
| <type_code></type_code> | |
| <input_output>in</input_output> | |
| <data_name>pass</data_name> | |
| </hash_0700239e745619d5ae1716147ca788b3d00a53> | |
| <hash_07002385dbb68d8941d19a4d51a6de025b82d1> | |
| <name>Username</name> | |
| <update_rra></update_rra> | |
| <regexp_match></regexp_match> | |
| <allow_nulls></allow_nulls> | |
| <type_code></type_code> | |
| <input_output>in</input_output> | |
| <data_name>user</data_name> | |
| </hash_07002385dbb68d8941d19a4d51a6de025b82d1> | |
| <hash_070023188eb9cda49083cfe18966e73467d274> | |
| <name>/file.mp3</name> | |
| <update_rra></update_rra> | |
| <regexp_match></regexp_match> | |
| <allow_nulls></allow_nulls> | |
| <type_code></type_code> | |
| <input_output>in</input_output> | |
| <data_name>mount</data_name> | |
| </hash_070023188eb9cda49083cfe18966e73467d274> | |
| <hash_07002378a9e256da3b449872f7c31f86d14a41> | |
| <name>URL of AdminXML</name> | |
| <update_rra></update_rra> | |
| <regexp_match></regexp_match> | |
| <allow_nulls></allow_nulls> | |
| <type_code></type_code> | |
| <input_output>in</input_output> | |
| <data_name>xml</data_name> | |
| </hash_07002378a9e256da3b449872f7c31f86d14a41> | |
| <hash_070023beebdfe69d8e98e2111c70c98a1829fa> | |
| <name>Current Listeners</name> | |
| <update_rra>on</update_rra> | |
| <regexp_match></regexp_match> | |
| <allow_nulls></allow_nulls> | |
| <type_code></type_code> | |
| <input_output>out</input_output> | |
| <data_name>current_listeners</data_name> | |
| </hash_070023beebdfe69d8e98e2111c70c98a1829fa> | |
| </fields> | |
| </hash_0300233214ae60d7a96ea3de89662cac24f62a> | |
| <hash_150023c21df5178e5c955013591239eb0afd46> | |
| <name>Daily (5 Minute Average)</name> | |
| <x_files_factor>0.5</x_files_factor> | |
| <steps>1</steps> | |
| <rows>600</rows> | |
| <timespan>86400</timespan> | |
| <cf_items>1|2|3|4</cf_items> | |
| </hash_150023c21df5178e5c955013591239eb0afd46> | |
| <hash_1500230d9c0af8b8acdc7807943937b3208e29> | |
| <name>Weekly (30 Minute Average)</name> | |
| <x_files_factor>0.5</x_files_factor> | |
| <steps>6</steps> | |
| <rows>700</rows> | |
| <timespan>604800</timespan> | |
| <cf_items>1|2|3|4</cf_items> | |
| </hash_1500230d9c0af8b8acdc7807943937b3208e29> | |
| <hash_1500236fc2d038fb42950138b0ce3e9874cc60> | |
| <name>Monthly (2 Hour Average)</name> | |
| <x_files_factor>0.5</x_files_factor> | |
| <steps>24</steps> | |
| <rows>775</rows> | |
| <timespan>2678400</timespan> | |
| <cf_items>1|2|3|4</cf_items> | |
| </hash_1500236fc2d038fb42950138b0ce3e9874cc60> | |
| <hash_150023e36f3adb9f152adfa5dc50fd2b23337e> | |
| <name>Yearly (1 Day Average)</name> | |
| <x_files_factor>0.5</x_files_factor> | |
| <steps>288</steps> | |
| <rows>797</rows> | |
| <timespan>33053184</timespan> | |
| <cf_items>1|2|3|4</cf_items> | |
| </hash_150023e36f3adb9f152adfa5dc50fd2b23337e> | |
| <hash_150023283ea2bf1634d92ce081ec82a634f513> | |
| <name>Hourly (1 Minute Average)</name> | |
| <x_files_factor>0.5</x_files_factor> | |
| <steps>1</steps> | |
| <rows>500</rows> | |
| <timespan>14400</timespan> | |
| <cf_items>1|2|3|4</cf_items> | |
| </hash_150023283ea2bf1634d92ce081ec82a634f513> | |
| <hash_060023e9c43831e54eca8069317a2ce8c6f751> | |
| <name>Normal</name> | |
| <gprint_text>%8.2lf %s</gprint_text> | |
| </hash_060023e9c43831e54eca8069317a2ce8c6f751> | |
| </cacti> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <cacti> | |
| <hash_0000231f72a3fe5643fdaf82728fd1054cbaee> | |
| <name>Icecast Listeners</name> | |
| <graph> | |
| <t_title></t_title> | |
| <title>|host_description| - |input_mount| - Current Icecast Listeners</title> | |
| <t_image_format_id></t_image_format_id> | |
| <image_format_id>1</image_format_id> | |
| <t_height></t_height> | |
| <height>120</height> | |
| <t_width></t_width> | |
| <width>500</width> | |
| <t_slope_mode></t_slope_mode> | |
| <slope_mode>on</slope_mode> | |
| <t_auto_scale></t_auto_scale> | |
| <auto_scale>on</auto_scale> | |
| <t_auto_scale_opts></t_auto_scale_opts> | |
| <auto_scale_opts>2</auto_scale_opts> | |
| <t_auto_scale_log></t_auto_scale_log> | |
| <auto_scale_log></auto_scale_log> | |
| <t_scale_log_units></t_scale_log_units> | |
| <scale_log_units></scale_log_units> | |
| <t_auto_scale_rigid></t_auto_scale_rigid> | |
| <auto_scale_rigid></auto_scale_rigid> | |
| <t_auto_padding></t_auto_padding> | |
| <auto_padding>on</auto_padding> | |
| <t_export></t_export> | |
| <export>on</export> | |
| <t_upper_limit></t_upper_limit> | |
| <upper_limit>100</upper_limit> | |
| <t_lower_limit></t_lower_limit> | |
| <lower_limit>0</lower_limit> | |
| <t_base_value></t_base_value> | |
| <base_value>1000</base_value> | |
| <t_unit_value></t_unit_value> | |
| <unit_value></unit_value> | |
| <t_unit_exponent_value></t_unit_exponent_value> | |
| <unit_exponent_value></unit_exponent_value> | |
| <t_vertical_label></t_vertical_label> | |
| <vertical_label>Listener Count</vertical_label> | |
| </graph> | |
| <items> | |
| <hash_1000237f73287dbafc047f62b663e328759208> | |
| <task_item_id>hash_08002317831988b74b45eb023d5da9abe866a3</task_item_id> | |
| <color_id>000000</color_id> | |
| <alpha>FF</alpha> | |
| <graph_type_id>5</graph_type_id> | |
| <consolidation_function_id>1</consolidation_function_id> | |
| <cdef_id>0</cdef_id> | |
| <value></value> | |
| <gprint_id>hash_060023e9c43831e54eca8069317a2ce8c6f751</gprint_id> | |
| <text_format>Average:</text_format> | |
| <hard_return></hard_return> | |
| <sequence>1</sequence> | |
| </hash_1000237f73287dbafc047f62b663e328759208> | |
| <hash_100023a7a87b0677d5942ddd18c182e755a5d9> | |
| <task_item_id>hash_08002317831988b74b45eb023d5da9abe866a3</task_item_id> | |
| <color_id>0</color_id> | |
| <alpha>FF</alpha> | |
| <graph_type_id>9</graph_type_id> | |
| <consolidation_function_id>1</consolidation_function_id> | |
| <cdef_id>0</cdef_id> | |
| <value></value> | |
| <gprint_id>hash_060023e9c43831e54eca8069317a2ce8c6f751</gprint_id> | |
| <text_format>Average:</text_format> | |
| <hard_return></hard_return> | |
| <sequence>2</sequence> | |
| </hash_100023a7a87b0677d5942ddd18c182e755a5d9> | |
| <hash_1000238d949793446df2dc6b2d209850d2e13e> | |
| <task_item_id>hash_08002317831988b74b45eb023d5da9abe866a3</task_item_id> | |
| <color_id>4444FF</color_id> | |
| <alpha>7F</alpha> | |
| <graph_type_id>4</graph_type_id> | |
| <consolidation_function_id>2</consolidation_function_id> | |
| <cdef_id>0</cdef_id> | |
| <value></value> | |
| <gprint_id>hash_060023e9c43831e54eca8069317a2ce8c6f751</gprint_id> | |
| <text_format>Min:</text_format> | |
| <hard_return></hard_return> | |
| <sequence>3</sequence> | |
| </hash_1000238d949793446df2dc6b2d209850d2e13e> | |
| <hash_1000230a1cb1b5e625076b6867d60f37ec59e1> | |
| <task_item_id>hash_08002317831988b74b45eb023d5da9abe866a3</task_item_id> | |
| <color_id>0</color_id> | |
| <alpha>FF</alpha> | |
| <graph_type_id>9</graph_type_id> | |
| <consolidation_function_id>2</consolidation_function_id> | |
| <cdef_id>0</cdef_id> | |
| <value></value> | |
| <gprint_id>hash_060023e9c43831e54eca8069317a2ce8c6f751</gprint_id> | |
| <text_format>Min:</text_format> | |
| <hard_return></hard_return> | |
| <sequence>4</sequence> | |
| </hash_1000230a1cb1b5e625076b6867d60f37ec59e1> | |
| <hash_1000234d987b8b3b6491da5bcbb6cc3250a5a7> | |
| <task_item_id>hash_08002317831988b74b45eb023d5da9abe866a3</task_item_id> | |
| <color_id>FF3932</color_id> | |
| <alpha>7F</alpha> | |
| <graph_type_id>4</graph_type_id> | |
| <consolidation_function_id>3</consolidation_function_id> | |
| <cdef_id>0</cdef_id> | |
| <value></value> | |
| <gprint_id>hash_060023e9c43831e54eca8069317a2ce8c6f751</gprint_id> | |
| <text_format>Max:</text_format> | |
| <hard_return></hard_return> | |
| <sequence>5</sequence> | |
| </hash_1000234d987b8b3b6491da5bcbb6cc3250a5a7> | |
| <hash_100023516552a38e4142c3decc9f0004ff44bb> | |
| <task_item_id>hash_08002317831988b74b45eb023d5da9abe866a3</task_item_id> | |
| <color_id>0</color_id> | |
| <alpha>FF</alpha> | |
| <graph_type_id>9</graph_type_id> | |
| <consolidation_function_id>3</consolidation_function_id> | |
| <cdef_id>0</cdef_id> | |
| <value></value> | |
| <gprint_id>hash_060023e9c43831e54eca8069317a2ce8c6f751</gprint_id> | |
| <text_format>Maximum:</text_format> | |
| <hard_return>on</hard_return> | |
| <sequence>6</sequence> | |
| </hash_100023516552a38e4142c3decc9f0004ff44bb> | |
| </items> | |
| <inputs> | |
| <hash_0900239d8567a1f18b7c8d506c65cea40f76cb> | |
| <name>Data Source [current_listeners]</name> | |
| <description></description> | |
| <column_name>task_item_id</column_name> | |
| <items>hash_0000237f73287dbafc047f62b663e328759208|hash_0000230a1cb1b5e625076b6867d60f37ec59e1|hash_000023a7a87b0677d5942ddd18c182e755a5d9|hash_000023516552a38e4142c3decc9f0004ff44bb|hash_0000238d949793446df2dc6b2d209850d2e13e|hash_0000234d987b8b3b6491da5bcbb6cc3250a5a7</items> | |
| </hash_0900239d8567a1f18b7c8d506c65cea40f76cb> | |
| </inputs> | |
| </hash_0000231f72a3fe5643fdaf82728fd1054cbaee> | |
| <hash_01002398a5f18c366c39f143dc40062c945971> | |
| <name>Icecast - Current Listeners</name> | |
| <ds> | |
| <t_name></t_name> | |
| <name>|host_description| - Current Icecast Listeners</name> | |
| <data_input_id>hash_0300233214ae60d7a96ea3de89662cac24f62a</data_input_id> | |
| <t_rra_id></t_rra_id> | |
| <t_rrd_step></t_rrd_step> | |
| <rrd_step>300</rrd_step> | |
| <t_active></t_active> | |
| <active>on</active> | |
| <rra_items>hash_150023c21df5178e5c955013591239eb0afd46|hash_1500230d9c0af8b8acdc7807943937b3208e29|hash_1500236fc2d038fb42950138b0ce3e9874cc60|hash_150023e36f3adb9f152adfa5dc50fd2b23337e|hash_150023283ea2bf1634d92ce081ec82a634f513</rra_items> | |
| </ds> | |
| <items> | |
| <hash_08002317831988b74b45eb023d5da9abe866a3> | |
| <t_data_source_name></t_data_source_name> | |
| <data_source_name>current_listeners</data_source_name> | |
| <t_rrd_minimum></t_rrd_minimum> | |
| <rrd_minimum>0</rrd_minimum> | |
| <t_rrd_maximum></t_rrd_maximum> | |
| <rrd_maximum>U</rrd_maximum> | |
| <t_data_source_type_id></t_data_source_type_id> | |
| <data_source_type_id>1</data_source_type_id> | |
| <t_rrd_heartbeat></t_rrd_heartbeat> | |
| <rrd_heartbeat>600</rrd_heartbeat> | |
| <t_data_input_field_id></t_data_input_field_id> | |
| <data_input_field_id>hash_070023beebdfe69d8e98e2111c70c98a1829fa</data_input_field_id> | |
| </hash_08002317831988b74b45eb023d5da9abe866a3> | |
| </items> | |
| <data> | |
| <item_000> | |
| <data_input_field_id>hash_0700239e745619d5ae1716147ca788b3d00a53</data_input_field_id> | |
| <t_value>on</t_value> | |
| <value></value> | |
| </item_000> | |
| <item_001> | |
| <data_input_field_id>hash_07002385dbb68d8941d19a4d51a6de025b82d1</data_input_field_id> | |
| <t_value>on</t_value> | |
| <value></value> | |
| </item_001> | |
| <item_002> | |
| <data_input_field_id>hash_070023188eb9cda49083cfe18966e73467d274</data_input_field_id> | |
| <t_value>on</t_value> | |
| <value></value> | |
| </item_002> | |
| <item_003> | |
| <data_input_field_id>hash_07002378a9e256da3b449872f7c31f86d14a41</data_input_field_id> | |
| <t_value>on</t_value> | |
| <value></value> | |
| </item_003> | |
| </data> | |
| </hash_01002398a5f18c366c39f143dc40062c945971> | |
| <hash_0300233214ae60d7a96ea3de89662cac24f62a> | |
| <name>Icecast Stats</name> | |
| <type_id>1</type_id> | |
| <input_string>python <path_cacti>/scripts/icecast.py -x <xml> -m <mount> -u <user> -p <pass></input_string> | |
| <fields> | |
| <hash_0700239e745619d5ae1716147ca788b3d00a53> | |
| <name>Password</name> | |
| <update_rra></update_rra> | |
| <regexp_match></regexp_match> | |
| <allow_nulls></allow_nulls> | |
| <type_code></type_code> | |
| <input_output>in</input_output> | |
| <data_name>pass</data_name> | |
| </hash_0700239e745619d5ae1716147ca788b3d00a53> | |
| <hash_07002385dbb68d8941d19a4d51a6de025b82d1> | |
| <name>Username</name> | |
| <update_rra></update_rra> | |
| <regexp_match></regexp_match> | |
| <allow_nulls></allow_nulls> | |
| <type_code></type_code> | |
| <input_output>in</input_output> | |
| <data_name>user</data_name> | |
| </hash_07002385dbb68d8941d19a4d51a6de025b82d1> | |
| <hash_070023188eb9cda49083cfe18966e73467d274> | |
| <name>/file.mp3</name> | |
| <update_rra></update_rra> | |
| <regexp_match></regexp_match> | |
| <allow_nulls></allow_nulls> | |
| <type_code></type_code> | |
| <input_output>in</input_output> | |
| <data_name>mount</data_name> | |
| </hash_070023188eb9cda49083cfe18966e73467d274> | |
| <hash_07002378a9e256da3b449872f7c31f86d14a41> | |
| <name>URL of AdminXML</name> | |
| <update_rra></update_rra> | |
| <regexp_match></regexp_match> | |
| <allow_nulls></allow_nulls> | |
| <type_code></type_code> | |
| <input_output>in</input_output> | |
| <data_name>xml</data_name> | |
| </hash_07002378a9e256da3b449872f7c31f86d14a41> | |
| <hash_070023beebdfe69d8e98e2111c70c98a1829fa> | |
| <name>Current Listeners</name> | |
| <update_rra>on</update_rra> | |
| <regexp_match></regexp_match> | |
| <allow_nulls></allow_nulls> | |
| <type_code></type_code> | |
| <input_output>out</input_output> | |
| <data_name>current_listeners</data_name> | |
| </hash_070023beebdfe69d8e98e2111c70c98a1829fa> | |
| </fields> | |
| </hash_0300233214ae60d7a96ea3de89662cac24f62a> | |
| <hash_150023c21df5178e5c955013591239eb0afd46> | |
| <name>Daily (5 Minute Average)</name> | |
| <x_files_factor>0.5</x_files_factor> | |
| <steps>1</steps> | |
| <rows>600</rows> | |
| <timespan>86400</timespan> | |
| <cf_items>1|2|3|4</cf_items> | |
| </hash_150023c21df5178e5c955013591239eb0afd46> | |
| <hash_1500230d9c0af8b8acdc7807943937b3208e29> | |
| <name>Weekly (30 Minute Average)</name> | |
| <x_files_factor>0.5</x_files_factor> | |
| <steps>6</steps> | |
| <rows>700</rows> | |
| <timespan>604800</timespan> | |
| <cf_items>1|2|3|4</cf_items> | |
| </hash_1500230d9c0af8b8acdc7807943937b3208e29> | |
| <hash_1500236fc2d038fb42950138b0ce3e9874cc60> | |
| <name>Monthly (2 Hour Average)</name> | |
| <x_files_factor>0.5</x_files_factor> | |
| <steps>24</steps> | |
| <rows>775</rows> | |
| <timespan>2678400</timespan> | |
| <cf_items>1|2|3|4</cf_items> | |
| </hash_1500236fc2d038fb42950138b0ce3e9874cc60> | |
| <hash_150023e36f3adb9f152adfa5dc50fd2b23337e> | |
| <name>Yearly (1 Day Average)</name> | |
| <x_files_factor>0.5</x_files_factor> | |
| <steps>288</steps> | |
| <rows>797</rows> | |
| <timespan>33053184</timespan> | |
| <cf_items>1|2|3|4</cf_items> | |
| </hash_150023e36f3adb9f152adfa5dc50fd2b23337e> | |
| <hash_150023283ea2bf1634d92ce081ec82a634f513> | |
| <name>Hourly (1 Minute Average)</name> | |
| <x_files_factor>0.5</x_files_factor> | |
| <steps>1</steps> | |
| <rows>500</rows> | |
| <timespan>14400</timespan> | |
| <cf_items>1|2|3|4</cf_items> | |
| </hash_150023283ea2bf1634d92ce081ec82a634f513> | |
| <hash_060023e9c43831e54eca8069317a2ce8c6f751> | |
| <name>Normal</name> | |
| <gprint_text>%8.2lf %s</gprint_text> | |
| </hash_060023e9c43831e54eca8069317a2ce8c6f751> | |
| </cacti> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <cacti> | |
| <hash_000023930547b7cfcb133ef834cefb36c9972f> | |
| <name>Mumble Stats</name> | |
| <graph> | |
| <t_title/> | |
| <title>|host_description| - Mumble</title> | |
| <t_image_format_id/> | |
| <image_format_id>1</image_format_id> | |
| <t_height/> | |
| <height>120</height> | |
| <t_width/> | |
| <width>500</width> | |
| <t_slope_mode/> | |
| <slope_mode>on</slope_mode> | |
| <t_auto_scale/> | |
| <auto_scale>on</auto_scale> | |
| <t_auto_scale_opts/> | |
| <auto_scale_opts>4</auto_scale_opts> | |
| <t_auto_scale_log/> | |
| <auto_scale_log/> | |
| <t_scale_log_units/> | |
| <scale_log_units/> | |
| <t_auto_scale_rigid/> | |
| <auto_scale_rigid/> | |
| <t_auto_padding/> | |
| <auto_padding>on</auto_padding> | |
| <t_export/> | |
| <export>on</export> | |
| <t_upper_limit/> | |
| <upper_limit>0</upper_limit> | |
| <t_lower_limit/> | |
| <lower_limit>0</lower_limit> | |
| <t_base_value/> | |
| <base_value>1000</base_value> | |
| <t_unit_value/> | |
| <unit_value/> | |
| <t_unit_exponent_value/> | |
| <unit_exponent_value/> | |
| <t_vertical_label/> | |
| <vertical_label>#</vertical_label> | |
| </graph> | |
| <items> | |
| <hash_1000235f27c8c14e068b002fd88b014a23fb70> | |
| <task_item_id>hash_080023fafac51047d780f8859b10c1be4e1246</task_item_id> | |
| <color_id>D2D8F9</color_id> | |
| <alpha>FF</alpha> | |
| <graph_type_id>7</graph_type_id> | |
| <consolidation_function_id>1</consolidation_function_id> | |
| <cdef_id>0</cdef_id> | |
| <value/> | |
| <gprint_id>hash_06002319414480d6897c8731c7dc6c5310653e</gprint_id> | |
| <text_format>Created Channels</text_format> | |
| <hard_return/> | |
| <sequence>1</sequence> | |
| </hash_1000235f27c8c14e068b002fd88b014a23fb70> | |
| <hash_1000231e10d5b42443fad3c5b448ac92345888> | |
| <task_item_id>hash_080023fafac51047d780f8859b10c1be4e1246</task_item_id> | |
| <color_id>0</color_id> | |
| <alpha>FF</alpha> | |
| <graph_type_id>9</graph_type_id> | |
| <consolidation_function_id>4</consolidation_function_id> | |
| <cdef_id>0</cdef_id> | |
| <value/> | |
| <gprint_id>hash_060023e9c43831e54eca8069317a2ce8c6f751</gprint_id> | |
| <text_format>Last:</text_format> | |
| <hard_return/> | |
| <sequence>2</sequence> | |
| </hash_1000231e10d5b42443fad3c5b448ac92345888> | |
| <hash_100023da9ab32d24f73ce13734c303eb6797a2> | |
| <task_item_id>hash_080023fafac51047d780f8859b10c1be4e1246</task_item_id> | |
| <color_id>0</color_id> | |
| <alpha>FF</alpha> | |
| <graph_type_id>9</graph_type_id> | |
| <consolidation_function_id>1</consolidation_function_id> | |
| <cdef_id>0</cdef_id> | |
| <value/> | |
| <gprint_id>hash_060023e9c43831e54eca8069317a2ce8c6f751</gprint_id> | |
| <text_format>Average:</text_format> | |
| <hard_return/> | |
| <sequence>3</sequence> | |
| </hash_100023da9ab32d24f73ce13734c303eb6797a2> | |
| <hash_10002364a0b96a09332a04ec1e33e10a94b5de> | |
| <task_item_id>hash_080023fafac51047d780f8859b10c1be4e1246</task_item_id> | |
| <color_id>0</color_id> | |
| <alpha>FF</alpha> | |
| <graph_type_id>9</graph_type_id> | |
| <consolidation_function_id>3</consolidation_function_id> | |
| <cdef_id>0</cdef_id> | |
| <value/> | |
| <gprint_id>hash_060023e9c43831e54eca8069317a2ce8c6f751</gprint_id> | |
| <text_format>Maximum:</text_format> | |
| <hard_return>on</hard_return> | |
| <sequence>4</sequence> | |
| </hash_10002364a0b96a09332a04ec1e33e10a94b5de> | |
| <hash_100023ea1f1500f6955078ca292fd82c91c0e5> | |
| <task_item_id>hash_080023c574da1a8bf4e987cf3d18c96fccf9c7</task_item_id> | |
| <color_id>35962B</color_id> | |
| <alpha>FF</alpha> | |
| <graph_type_id>5</graph_type_id> | |
| <consolidation_function_id>1</consolidation_function_id> | |
| <cdef_id>0</cdef_id> | |
| <value/> | |
| <gprint_id>hash_06002319414480d6897c8731c7dc6c5310653e</gprint_id> | |
| <text_format>Connected Users</text_format> | |
| <hard_return/> | |
| <sequence>5</sequence> | |
| </hash_100023ea1f1500f6955078ca292fd82c91c0e5> | |
| <hash_100023377340dd750ecc49055f1c404c9b2837> | |
| <task_item_id>hash_080023c574da1a8bf4e987cf3d18c96fccf9c7</task_item_id> | |
| <color_id>0</color_id> | |
| <alpha>FF</alpha> | |
| <graph_type_id>9</graph_type_id> | |
| <consolidation_function_id>4</consolidation_function_id> | |
| <cdef_id>0</cdef_id> | |
| <value/> | |
| <gprint_id>hash_060023e9c43831e54eca8069317a2ce8c6f751</gprint_id> | |
| <text_format>Last:</text_format> | |
| <hard_return/> | |
| <sequence>6</sequence> | |
| </hash_100023377340dd750ecc49055f1c404c9b2837> | |
| <hash_1000233544048cca0dd0ab746198ff2b0e6459> | |
| <task_item_id>hash_080023c574da1a8bf4e987cf3d18c96fccf9c7</task_item_id> | |
| <color_id>0</color_id> | |
| <alpha>FF</alpha> | |
| <graph_type_id>9</graph_type_id> | |
| <consolidation_function_id>1</consolidation_function_id> | |
| <cdef_id>0</cdef_id> | |
| <value/> | |
| <gprint_id>hash_060023e9c43831e54eca8069317a2ce8c6f751</gprint_id> | |
| <text_format>Average:</text_format> | |
| <hard_return/> | |
| <sequence>7</sequence> | |
| </hash_1000233544048cca0dd0ab746198ff2b0e6459> | |
| <hash_100023680f8205731b3046ea56ed85538752a9> | |
| <task_item_id>hash_080023c574da1a8bf4e987cf3d18c96fccf9c7</task_item_id> | |
| <color_id>0</color_id> | |
| <alpha>FF</alpha> | |
| <graph_type_id>9</graph_type_id> | |
| <consolidation_function_id>3</consolidation_function_id> | |
| <cdef_id>0</cdef_id> | |
| <value/> | |
| <gprint_id>hash_060023e9c43831e54eca8069317a2ce8c6f751</gprint_id> | |
| <text_format>Maximum:</text_format> | |
| <hard_return>on</hard_return> | |
| <sequence>8</sequence> | |
| </hash_100023680f8205731b3046ea56ed85538752a9> | |
| </items> | |
| <inputs> | |
| <hash_0900236fdde9326c6f32618d3a40ac47cbc895> | |
| <name>Data Source [chans]</name> | |
| <description/> | |
| <column_name>task_item_id</column_name> | |
| <items> | |
| hash_0000235f27c8c14e068b002fd88b014a23fb70|hash_0000231e10d5b42443fad3c5b448ac92345888|hash_000023da9ab32d24f73ce13734c303eb6797a2|hash_00002364a0b96a09332a04ec1e33e10a94b5de | |
| </items> | |
| </hash_0900236fdde9326c6f32618d3a40ac47cbc895> | |
| <hash_0900231ef29af16e765dce6147eb71f5f05fd7> | |
| <name>Data Source [users]</name> | |
| <description/> | |
| <column_name>task_item_id</column_name> | |
| <items> | |
| hash_000023ea1f1500f6955078ca292fd82c91c0e5|hash_000023377340dd750ecc49055f1c404c9b2837|hash_0000233544048cca0dd0ab746198ff2b0e6459|hash_000023680f8205731b3046ea56ed85538752a9 | |
| </items> | |
| </hash_0900231ef29af16e765dce6147eb71f5f05fd7> | |
| </inputs> | |
| </hash_000023930547b7cfcb133ef834cefb36c9972f> | |
| <hash_010023d4e40dff32efe77d32c94dc981686bec> | |
| <name>MumbleStats</name> | |
| <ds> | |
| <t_name/> | |
| <name>|host_description| - Mumble</name> | |
| <data_input_id>hash_030023e6fdb096e0bf03179131dc999fb8df1c</data_input_id> | |
| <t_rra_id/> | |
| <t_rrd_step/> | |
| <rrd_step>300</rrd_step> | |
| <t_active/> | |
| <active>on</active> | |
| <rra_items> | |
| hash_150023c21df5178e5c955013591239eb0afd46|hash_1500230d9c0af8b8acdc7807943937b3208e29|hash_1500236fc2d038fb42950138b0ce3e9874cc60|hash_150023e36f3adb9f152adfa5dc50fd2b23337e|hash_150023283ea2bf1634d92ce081ec82a634f513 | |
| </rra_items> | |
| </ds> | |
| <items> | |
| <hash_080023fafac51047d780f8859b10c1be4e1246> | |
| <t_data_source_name/> | |
| <data_source_name>chans</data_source_name> | |
| <t_rrd_minimum/> | |
| <rrd_minimum>0</rrd_minimum> | |
| <t_rrd_maximum/> | |
| <rrd_maximum>100</rrd_maximum> | |
| <t_data_source_type_id/> | |
| <data_source_type_id>1</data_source_type_id> | |
| <t_rrd_heartbeat/> | |
| <rrd_heartbeat>600</rrd_heartbeat> | |
| <t_data_input_field_id/> | |
| <data_input_field_id>hash_0700238d44331946b7ec161ae360a8ae29736b</data_input_field_id> | |
| </hash_080023fafac51047d780f8859b10c1be4e1246> | |
| <hash_080023c574da1a8bf4e987cf3d18c96fccf9c7> | |
| <t_data_source_name/> | |
| <data_source_name>users</data_source_name> | |
| <t_rrd_minimum/> | |
| <rrd_minimum>0</rrd_minimum> | |
| <t_rrd_maximum/> | |
| <rrd_maximum>30</rrd_maximum> | |
| <t_data_source_type_id/> | |
| <data_source_type_id>1</data_source_type_id> | |
| <t_rrd_heartbeat/> | |
| <rrd_heartbeat>600</rrd_heartbeat> | |
| <t_data_input_field_id/> | |
| <data_input_field_id>hash_0700230c57f7cf4ce5c67d892435df989774d4</data_input_field_id> | |
| </hash_080023c574da1a8bf4e987cf3d18c96fccf9c7> | |
| </items> | |
| <data></data> | |
| </hash_010023d4e40dff32efe77d32c94dc981686bec> | |
| <hash_030023e6fdb096e0bf03179131dc999fb8df1c> | |
| <name>MumbleStats</name> | |
| <type_id>1</type_id> | |
| <input_string>perl /var/www/scripts/mumble.pl</input_string> | |
| <fields> | |
| <hash_0700230c57f7cf4ce5c67d892435df989774d4> | |
| <name>Users</name> | |
| <update_rra>on</update_rra> | |
| <regexp_match/> | |
| <allow_nulls/> | |
| <type_code/> | |
| <input_output>out</input_output> | |
| <data_name>users</data_name> | |
| </hash_0700230c57f7cf4ce5c67d892435df989774d4> | |
| <hash_0700238d44331946b7ec161ae360a8ae29736b> | |
| <name>Channels</name> | |
| <update_rra>on</update_rra> | |
| <regexp_match/> | |
| <allow_nulls/> | |
| <type_code/> | |
| <input_output>out</input_output> | |
| <data_name>chans</data_name> | |
| </hash_0700238d44331946b7ec161ae360a8ae29736b> | |
| </fields> | |
| </hash_030023e6fdb096e0bf03179131dc999fb8df1c> | |
| <hash_150023c21df5178e5c955013591239eb0afd46> | |
| <name>Daily (5 Minute Average)</name> | |
| <x_files_factor>0.5</x_files_factor> | |
| <steps>1</steps> | |
| <rows>600</rows> | |
| <timespan>86400</timespan> | |
| <cf_items>1|2|3|4</cf_items> | |
| </hash_150023c21df5178e5c955013591239eb0afd46> | |
| <hash_1500230d9c0af8b8acdc7807943937b3208e29> | |
| <name>Weekly (30 Minute Average)</name> | |
| <x_files_factor>0.5</x_files_factor> | |
| <steps>6</steps> | |
| <rows>700</rows> | |
| <timespan>604800</timespan> | |
| <cf_items>1|2|3|4</cf_items> | |
| </hash_1500230d9c0af8b8acdc7807943937b3208e29> | |
| <hash_1500236fc2d038fb42950138b0ce3e9874cc60> | |
| <name>Monthly (2 Hour Average)</name> | |
| <x_files_factor>0.5</x_files_factor> | |
| <steps>24</steps> | |
| <rows>775</rows> | |
| <timespan>2678400</timespan> | |
| <cf_items>1|2|3|4</cf_items> | |
| </hash_1500236fc2d038fb42950138b0ce3e9874cc60> | |
| <hash_150023e36f3adb9f152adfa5dc50fd2b23337e> | |
| <name>Yearly (1 Day Average)</name> | |
| <x_files_factor>0.5</x_files_factor> | |
| <steps>288</steps> | |
| <rows>797</rows> | |
| <timespan>33053184</timespan> | |
| <cf_items>1|2|3|4</cf_items> | |
| </hash_150023e36f3adb9f152adfa5dc50fd2b23337e> | |
| <hash_150023283ea2bf1634d92ce081ec82a634f513> | |
| <name>Hourly (1 Minute Average)</name> | |
| <x_files_factor>0.5</x_files_factor> | |
| <steps>1</steps> | |
| <rows>500</rows> | |
| <timespan>14400</timespan> | |
| <cf_items>1|2|3|4</cf_items> | |
| </hash_150023283ea2bf1634d92ce081ec82a634f513> | |
| <hash_060023e9c43831e54eca8069317a2ce8c6f751> | |
| <name>Normal</name> | |
| <gprint_text>%8.2lf %s</gprint_text> | |
| </hash_060023e9c43831e54eca8069317a2ce8c6f751> | |
| <hash_06002319414480d6897c8731c7dc6c5310653e> | |
| <name>Exact Numbers</name> | |
| <gprint_text>%8.0lf</gprint_text> | |
| </hash_06002319414480d6897c8731c7dc6c5310653e> | |
| </cacti> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <cacti> | |
| <hash_000023930547b7cfcb133ef834cefb36c9972f> | |
| <name>Mumble Stats</name> | |
| <graph> | |
| <t_title/> | |
| <title>|host_description| - Mumble</title> | |
| <t_image_format_id/> | |
| <image_format_id>1</image_format_id> | |
| <t_height/> | |
| <height>120</height> | |
| <t_width/> | |
| <width>500</width> | |
| <t_slope_mode/> | |
| <slope_mode>on</slope_mode> | |
| <t_auto_scale/> | |
| <auto_scale>on</auto_scale> | |
| <t_auto_scale_opts/> | |
| <auto_scale_opts>4</auto_scale_opts> | |
| <t_auto_scale_log/> | |
| <auto_scale_log/> | |
| <t_scale_log_units/> | |
| <scale_log_units/> | |
| <t_auto_scale_rigid/> | |
| <auto_scale_rigid/> | |
| <t_auto_padding/> | |
| <auto_padding>on</auto_padding> | |
| <t_export/> | |
| <export>on</export> | |
| <t_upper_limit/> | |
| <upper_limit>0</upper_limit> | |
| <t_lower_limit/> | |
| <lower_limit>0</lower_limit> | |
| <t_base_value/> | |
| <base_value>1000</base_value> | |
| <t_unit_value/> | |
| <unit_value/> | |
| <t_unit_exponent_value/> | |
| <unit_exponent_value/> | |
| <t_vertical_label/> | |
| <vertical_label>#</vertical_label> | |
| </graph> | |
| <items> | |
| <hash_1000235f27c8c14e068b002fd88b014a23fb70> | |
| <task_item_id>hash_080023fafac51047d780f8859b10c1be4e1246</task_item_id> | |
| <color_id>D2D8F9</color_id> | |
| <alpha>FF</alpha> | |
| <graph_type_id>7</graph_type_id> | |
| <consolidation_function_id>1</consolidation_function_id> | |
| <cdef_id>0</cdef_id> | |
| <value/> | |
| <gprint_id>hash_06002319414480d6897c8731c7dc6c5310653e</gprint_id> | |
| <text_format>Created Channels</text_format> | |
| <hard_return/> | |
| <sequence>1</sequence> | |
| </hash_1000235f27c8c14e068b002fd88b014a23fb70> | |
| <hash_1000231e10d5b42443fad3c5b448ac92345888> | |
| <task_item_id>hash_080023fafac51047d780f8859b10c1be4e1246</task_item_id> | |
| <color_id>0</color_id> | |
| <alpha>FF</alpha> | |
| <graph_type_id>9</graph_type_id> | |
| <consolidation_function_id>4</consolidation_function_id> | |
| <cdef_id>0</cdef_id> | |
| <value/> | |
| <gprint_id>hash_060023e9c43831e54eca8069317a2ce8c6f751</gprint_id> | |
| <text_format>Last:</text_format> | |
| <hard_return/> | |
| <sequence>2</sequence> | |
| </hash_1000231e10d5b42443fad3c5b448ac92345888> | |
| <hash_100023da9ab32d24f73ce13734c303eb6797a2> | |
| <task_item_id>hash_080023fafac51047d780f8859b10c1be4e1246</task_item_id> | |
| <color_id>0</color_id> | |
| <alpha>FF</alpha> | |
| <graph_type_id>9</graph_type_id> | |
| <consolidation_function_id>1</consolidation_function_id> | |
| <cdef_id>0</cdef_id> | |
| <value/> | |
| <gprint_id>hash_060023e9c43831e54eca8069317a2ce8c6f751</gprint_id> | |
| <text_format>Average:</text_format> | |
| <hard_return/> | |
| <sequence>3</sequence> | |
| </hash_100023da9ab32d24f73ce13734c303eb6797a2> | |
| <hash_10002364a0b96a09332a04ec1e33e10a94b5de> | |
| <task_item_id>hash_080023fafac51047d780f8859b10c1be4e1246</task_item_id> | |
| <color_id>0</color_id> | |
| <alpha>FF</alpha> | |
| <graph_type_id>9</graph_type_id> | |
| <consolidation_function_id>3</consolidation_function_id> | |
| <cdef_id>0</cdef_id> | |
| <value/> | |
| <gprint_id>hash_060023e9c43831e54eca8069317a2ce8c6f751</gprint_id> | |
| <text_format>Maximum:</text_format> | |
| <hard_return>on</hard_return> | |
| <sequence>4</sequence> | |
| </hash_10002364a0b96a09332a04ec1e33e10a94b5de> | |
| <hash_100023ea1f1500f6955078ca292fd82c91c0e5> | |
| <task_item_id>hash_080023c574da1a8bf4e987cf3d18c96fccf9c7</task_item_id> | |
| <color_id>35962B</color_id> | |
| <alpha>FF</alpha> | |
| <graph_type_id>5</graph_type_id> | |
| <consolidation_function_id>1</consolidation_function_id> | |
| <cdef_id>0</cdef_id> | |
| <value/> | |
| <gprint_id>hash_06002319414480d6897c8731c7dc6c5310653e</gprint_id> | |
| <text_format>Connected Users</text_format> | |
| <hard_return/> | |
| <sequence>5</sequence> | |
| </hash_100023ea1f1500f6955078ca292fd82c91c0e5> | |
| <hash_100023377340dd750ecc49055f1c404c9b2837> | |
| <task_item_id>hash_080023c574da1a8bf4e987cf3d18c96fccf9c7</task_item_id> | |
| <color_id>0</color_id> | |
| <alpha>FF</alpha> | |
| <graph_type_id>9</graph_type_id> | |
| <consolidation_function_id>4</consolidation_function_id> | |
| <cdef_id>0</cdef_id> | |
| <value/> | |
| <gprint_id>hash_060023e9c43831e54eca8069317a2ce8c6f751</gprint_id> | |
| <text_format>Last:</text_format> | |
| <hard_return/> | |
| <sequence>6</sequence> | |
| </hash_100023377340dd750ecc49055f1c404c9b2837> | |
| <hash_1000233544048cca0dd0ab746198ff2b0e6459> | |
| <task_item_id>hash_080023c574da1a8bf4e987cf3d18c96fccf9c7</task_item_id> | |
| <color_id>0</color_id> | |
| <alpha>FF</alpha> | |
| <graph_type_id>9</graph_type_id> | |
| <consolidation_function_id>1</consolidation_function_id> | |
| <cdef_id>0</cdef_id> | |
| <value/> | |
| <gprint_id>hash_060023e9c43831e54eca8069317a2ce8c6f751</gprint_id> | |
| <text_format>Average:</text_format> | |
| <hard_return/> | |
| <sequence>7</sequence> | |
| </hash_1000233544048cca0dd0ab746198ff2b0e6459> | |
| <hash_100023680f8205731b3046ea56ed85538752a9> | |
| <task_item_id>hash_080023c574da1a8bf4e987cf3d18c96fccf9c7</task_item_id> | |
| <color_id>0</color_id> | |
| <alpha>FF</alpha> | |
| <graph_type_id>9</graph_type_id> | |
| <consolidation_function_id>3</consolidation_function_id> | |
| <cdef_id>0</cdef_id> | |
| <value/> | |
| <gprint_id>hash_060023e9c43831e54eca8069317a2ce8c6f751</gprint_id> | |
| <text_format>Maximum:</text_format> | |
| <hard_return>on</hard_return> | |
| <sequence>8</sequence> | |
| </hash_100023680f8205731b3046ea56ed85538752a9> | |
| </items> | |
| <inputs> | |
| <hash_0900236fdde9326c6f32618d3a40ac47cbc895> | |
| <name>Data Source [chans]</name> | |
| <description/> | |
| <column_name>task_item_id</column_name> | |
| <items> | |
| hash_0000235f27c8c14e068b002fd88b014a23fb70|hash_0000231e10d5b42443fad3c5b448ac92345888|hash_000023da9ab32d24f73ce13734c303eb6797a2|hash_00002364a0b96a09332a04ec1e33e10a94b5de | |
| </items> | |
| </hash_0900236fdde9326c6f32618d3a40ac47cbc895> | |
| <hash_0900231ef29af16e765dce6147eb71f5f05fd7> | |
| <name>Data Source [users]</name> | |
| <description/> | |
| <column_name>task_item_id</column_name> | |
| <items> | |
| hash_000023ea1f1500f6955078ca292fd82c91c0e5|hash_000023377340dd750ecc49055f1c404c9b2837|hash_0000233544048cca0dd0ab746198ff2b0e6459|hash_000023680f8205731b3046ea56ed85538752a9 | |
| </items> | |
| </hash_0900231ef29af16e765dce6147eb71f5f05fd7> | |
| </inputs> | |
| </hash_000023930547b7cfcb133ef834cefb36c9972f> | |
| <hash_010023d4e40dff32efe77d32c94dc981686bec> | |
| <name>MumbleStats</name> | |
| <ds> | |
| <t_name/> | |
| <name>|host_description| - Mumble</name> | |
| <data_input_id>hash_030023e6fdb096e0bf03179131dc999fb8df1c</data_input_id> | |
| <t_rra_id/> | |
| <t_rrd_step/> | |
| <rrd_step>300</rrd_step> | |
| <t_active/> | |
| <active>on</active> | |
| <rra_items> | |
| hash_150023c21df5178e5c955013591239eb0afd46|hash_1500230d9c0af8b8acdc7807943937b3208e29|hash_1500236fc2d038fb42950138b0ce3e9874cc60|hash_150023e36f3adb9f152adfa5dc50fd2b23337e|hash_150023283ea2bf1634d92ce081ec82a634f513 | |
| </rra_items> | |
| </ds> | |
| <items> | |
| <hash_080023fafac51047d780f8859b10c1be4e1246> | |
| <t_data_source_name/> | |
| <data_source_name>chans</data_source_name> | |
| <t_rrd_minimum/> | |
| <rrd_minimum>0</rrd_minimum> | |
| <t_rrd_maximum/> | |
| <rrd_maximum>100</rrd_maximum> | |
| <t_data_source_type_id/> | |
| <data_source_type_id>1</data_source_type_id> | |
| <t_rrd_heartbeat/> | |
| <rrd_heartbeat>600</rrd_heartbeat> | |
| <t_data_input_field_id/> | |
| <data_input_field_id>hash_0700238d44331946b7ec161ae360a8ae29736b</data_input_field_id> | |
| </hash_080023fafac51047d780f8859b10c1be4e1246> | |
| <hash_080023c574da1a8bf4e987cf3d18c96fccf9c7> | |
| <t_data_source_name/> | |
| <data_source_name>users</data_source_name> | |
| <t_rrd_minimum/> | |
| <rrd_minimum>0</rrd_minimum> | |
| <t_rrd_maximum/> | |
| <rrd_maximum>30</rrd_maximum> | |
| <t_data_source_type_id/> | |
| <data_source_type_id>1</data_source_type_id> | |
| <t_rrd_heartbeat/> | |
| <rrd_heartbeat>600</rrd_heartbeat> | |
| <t_data_input_field_id/> | |
| <data_input_field_id>hash_0700230c57f7cf4ce5c67d892435df989774d4</data_input_field_id> | |
| </hash_080023c574da1a8bf4e987cf3d18c96fccf9c7> | |
| </items> | |
| <data></data> | |
| </hash_010023d4e40dff32efe77d32c94dc981686bec> | |
| <hash_030023e6fdb096e0bf03179131dc999fb8df1c> | |
| <name>MumbleStats</name> | |
| <type_id>1</type_id> | |
| <input_string>perl /var/www/scripts/mumble.pl</input_string> | |
| <fields> | |
| <hash_0700230c57f7cf4ce5c67d892435df989774d4> | |
| <name>Users</name> | |
| <update_rra>on</update_rra> | |
| <regexp_match/> | |
| <allow_nulls/> | |
| <type_code/> | |
| <input_output>out</input_output> | |
| <data_name>users</data_name> | |
| </hash_0700230c57f7cf4ce5c67d892435df989774d4> | |
| <hash_0700238d44331946b7ec161ae360a8ae29736b> | |
| <name>Channels</name> | |
| <update_rra>on</update_rra> | |
| <regexp_match/> | |
| <allow_nulls/> | |
| <type_code/> | |
| <input_output>out</input_output> | |
| <data_name>chans</data_name> | |
| </hash_0700238d44331946b7ec161ae360a8ae29736b> | |
| </fields> | |
| </hash_030023e6fdb096e0bf03179131dc999fb8df1c> | |
| <hash_150023c21df5178e5c955013591239eb0afd46> | |
| <name>Daily (5 Minute Average)</name> | |
| <x_files_factor>0.5</x_files_factor> | |
| <steps>1</steps> | |
| <rows>600</rows> | |
| <timespan>86400</timespan> | |
| <cf_items>1|2|3|4</cf_items> | |
| </hash_150023c21df5178e5c955013591239eb0afd46> | |
| <hash_1500230d9c0af8b8acdc7807943937b3208e29> | |
| <name>Weekly (30 Minute Average)</name> | |
| <x_files_factor>0.5</x_files_factor> | |
| <steps>6</steps> | |
| <rows>700</rows> | |
| <timespan>604800</timespan> | |
| <cf_items>1|2|3|4</cf_items> | |
| </hash_1500230d9c0af8b8acdc7807943937b3208e29> | |
| <hash_1500236fc2d038fb42950138b0ce3e9874cc60> | |
| <name>Monthly (2 Hour Average)</name> | |
| <x_files_factor>0.5</x_files_factor> | |
| <steps>24</steps> | |
| <rows>775</rows> | |
| <timespan>2678400</timespan> | |
| <cf_items>1|2|3|4</cf_items> | |
| </hash_1500236fc2d038fb42950138b0ce3e9874cc60> | |
| <hash_150023e36f3adb9f152adfa5dc50fd2b23337e> | |
| <name>Yearly (1 Day Average)</name> | |
| <x_files_factor>0.5</x_files_factor> | |
| <steps>288</steps> | |
| <rows>797</rows> | |
| <timespan>33053184</timespan> | |
| <cf_items>1|2|3|4</cf_items> | |
| </hash_150023e36f3adb9f152adfa5dc50fd2b23337e> | |
| <hash_150023283ea2bf1634d92ce081ec82a634f513> | |
| <name>Hourly (1 Minute Average)</name> | |
| <x_files_factor>0.5</x_files_factor> | |
| <steps>1</steps> | |
| <rows>500</rows> | |
| <timespan>14400</timespan> | |
| <cf_items>1|2|3|4</cf_items> | |
| </hash_150023283ea2bf1634d92ce081ec82a634f513> | |
| <hash_060023e9c43831e54eca8069317a2ce8c6f751> | |
| <name>Normal</name> | |
| <gprint_text>%8.2lf %s</gprint_text> | |
| </hash_060023e9c43831e54eca8069317a2ce8c6f751> | |
| <hash_06002319414480d6897c8731c7dc6c5310653e> | |
| <name>Exact Numbers</name> | |
| <gprint_text>%8.0lf</gprint_text> | |
| </hash_06002319414480d6897c8731c7dc6c5310653e> | |
| </cacti> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| #this file goes in your /scripts/ folder | |
| import urllib, urllib2, httplib, sys, getopt | |
| from xml.dom.minidom import parse, parseString | |
| DEBUG = False | |
| opts, args = getopt.getopt(sys.argv[1:], "x:m:u:p:", ["xml=", "mount=", "user=", "password="]) | |
| xml = 'http://radio.overviewer.org/admin/stats.xml' | |
| mount = '/writhem.mp3' | |
| user = 'admin' | |
| password = 'poop' | |
| listeners = 0 | |
| for o, v in opts: | |
| if o in ("-x", "--xml"): | |
| xml = str(v) | |
| elif o in ("-m", "--mount"): | |
| mount = str(v) | |
| elif o in ("-u", "--user"): | |
| user = str(v) | |
| elif o in ("-p", "--password"): | |
| password = str(v) | |
| password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm() | |
| password_mgr.add_password(None, xml, user, password) | |
| handler = urllib2.HTTPBasicAuthHandler(password_mgr) | |
| opener = urllib2.build_opener(handler) | |
| try: | |
| file_obj = opener.open(xml) | |
| dom = parseString(file_obj.read()) | |
| for element in dom.getElementsByTagName('icestats'): | |
| source = element.getElementsByTagName('source') | |
| for n in range(1, len(source)): | |
| if (source[n].getAttribute('mount') == mount): | |
| listeners = source[n].getElementsByTagName('listeners')[0].firstChild.data | |
| except IOError, e: | |
| listeners = "Error: %s" % e | |
| if (listeners == 1): | |
| strCurrentListeners = "1 Current Listener" | |
| else: | |
| strCurrentListeners = "%s Current Listeners" % str(listeners) | |
| outstr = 'current_listeners:%s' % str(listeners) | |
| print outstr | |
| if DEBUG: | |
| import syslog | |
| outstr += "(%s)" % file_obj | |
| syslog.syslog(outstr) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| #this file goes in your /scripts/ folder | |
| import urllib, urllib2, httplib, sys, getopt | |
| from xml.dom.minidom import parse, parseString | |
| DEBUG = False | |
| opts, args = getopt.getopt(sys.argv[1:], "x:m:u:p:", ["xml=", "mount=", "user=", "password="]) | |
| xml = 'http://radio.overviewer.org/admin/stats.xml' | |
| mount = '/writhem.mp3' | |
| user = 'admin' | |
| password = 'poop' | |
| listeners = 0 | |
| for o, v in opts: | |
| if o in ("-x", "--xml"): | |
| xml = str(v) | |
| elif o in ("-m", "--mount"): | |
| mount = str(v) | |
| elif o in ("-u", "--user"): | |
| user = str(v) | |
| elif o in ("-p", "--password"): | |
| password = str(v) | |
| password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm() | |
| password_mgr.add_password(None, xml, user, password) | |
| handler = urllib2.HTTPBasicAuthHandler(password_mgr) | |
| opener = urllib2.build_opener(handler) | |
| try: | |
| file_obj = opener.open(xml) | |
| dom = parseString(file_obj.read()) | |
| for element in dom.getElementsByTagName('icestats'): | |
| source = element.getElementsByTagName('source') | |
| for n in range(1, len(source)): | |
| if (source[n].getAttribute('mount') == mount): | |
| listeners = source[n].getElementsByTagName('listeners')[0].firstChild.data | |
| except IOError, e: | |
| listeners = "Error: %s" % e | |
| if (listeners == 1): | |
| strCurrentListeners = "1 Current Listener" | |
| else: | |
| strCurrentListeners = "%s Current Listeners" % str(listeners) | |
| outstr = 'current_listeners:%s' % str(listeners) | |
| print outstr | |
| if DEBUG: | |
| import syslog | |
| outstr += "(%s)" % file_obj | |
| syslog.syslog(outstr) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import urllib, urllib2, httplib | |
| import sys, getopt | |
| import re | |
| from urllib2 import Request, HTTPError, URLError | |
| DEBUG = False | |
| url = None | |
| opts, args = getopt.getopt(sys.argv[1:], "u:d:", ["usr=", "debug="]) | |
| for o, v in opts: | |
| if o in ("-u", "--user"): | |
| url = 'http://raptr.com/' + str(v) + '/about' | |
| elif o in ("-d", "--debug"): | |
| DEBUG = True | |
| if url == None: | |
| raise ValueError("bad user name, indicate user with -u <name> or --user=<name>") | |
| request = urllib2.Request(url) | |
| request.add_header('User-agent','Cacti-Python AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1') | |
| try: | |
| response = urllib2.urlopen(request) | |
| data = response.read() | |
| items=dict() | |
| ## capture the game count. | |
| regex = re.compile(r'\\/games\\">(.*) games<\\/a>') | |
| m = regex.search(data) | |
| if m: | |
| items.update({'games':int(m.group(1).replace(",",""))}) | |
| ## capture the game hours. | |
| regex = re.compile(r'\\/games\\">.*\\/games\\">(.*) hours tracked<\\/a>') | |
| m = regex.search(data) | |
| if m: | |
| items.update({'hours':int(m.group(1).replace(",",""))}) | |
| ## capture the achievements. | |
| regex = re.compile(r'\\/achievements\\">(.*) achievements<\\/a>') | |
| m = regex.search(data) | |
| if m: | |
| items.update({'achievements':int(m.group(1).replace(",",""))}) | |
| except HTTPError, e: | |
| if DEBUG: | |
| print 'ERROR CODE:', e.code | |
| #print 'ERROR DATA:', e.read() | |
| sys.exit() except URLError, e: | |
| if DEBUG: | |
| print 'ERROR REASON:', e.reason | |
| sys.exit() | |
| outstr = u'' for k, v in sorted(items.items()): | |
| outstr = outstr + u'{0}:{1} '.format(k, v) print outstr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/perl | |
| #this file goes in your /scripts/ folder | |
| use warnings; | |
| use strict; | |
| use LWP::Simple; | |
| use Date::Parse; | |
| use Switch; | |
| my $timeout = 200; | |
| my $total_time = 36; | |
| my $httpaddr = "http://wx.ca/"; | |
| my $content; | |
| my $fail = 0; | |
| my $tries = 0; | |
| my %data; | |
| my %trash; | |
| my @keys; | |
| do{ | |
| eval { | |
| local $SIG{ALRM} = sub { die "alarm\n" }; | |
| alarm $timeout; | |
| $tries++; | |
| $content = LWP::Simple::get($httpaddr); | |
| alarm 0; | |
| }; | |
| } while (!$content && $tries <= int($total_time / $timeout)); | |
| $data{Tries} = $tries; | |
| if (!$content) { | |
| exit(2); | |
| } | |
| # find the now table. | |
| my $indexOfStart = index($content, "<table id=\"now\""); | |
| my $indexOfEnd = index($content, "</table></td>", $indexOfStart); | |
| my $_ = substr($content,$indexOfStart,$indexOfEnd - $indexOfStart); | |
| #s/nbsp;/ /g; | |
| #s/<.+?>//g; | |
| #s/\s+/ /g; | |
| @keys = ("Temperature","WindDirection","WindSpeedLow","WindSpeedHigh","BaroPressure","Preceipitation","Lightning","QueryTime"); | |
| my $n = 0; | |
| my $indexValue = index($_,"<td class=\"value\"", 0); | |
| for(; $indexValue != -1;) | |
| { | |
| my $indexValueStart = index($_,">",$indexValue)+1; | |
| my $indexValueEnd = index($_,"<",$indexValue+2); | |
| my $temp = $keys[$n]; | |
| #print "debug: " . $temp; | |
| if ($temp eq "WindDirection") { | |
| #god damned wind direction | |
| switch(substr($_,$indexValueStart,$indexValueEnd-$indexValueStart)) { | |
| case ("N") { $data{WindDirection} = 1; } | |
| case ("NNE") { $data{WindDirection} = 1.5; } | |
| case ("NE") { $data{WindDirection} = 2; } | |
| case ("NEE") { $data{WindDirection} = 2.5; } | |
| case ("E") { $data{WindDirection} = 3; } | |
| case ("SSE") { $data{WindDirection} = 3.5; } | |
| case ("SE") { $data{WindDirection} = 4; } | |
| case ("SEE") { $data{WindDirection} = 4.5; } | |
| case ("S") { $data{WindDirection} = 5; } | |
| case ("SSW") { $data{WindDirection} = 5.5; } | |
| case ("SW") { $data{WindDirection} = 6; } | |
| case ("SWW") { $data{WindDirection} = 6.5; } | |
| case ("W") { $data{WindDirection} = 7; } | |
| case ("NNW") { $data{WindDirection} = 7.5; } | |
| case ("NW") { $data{WindDirection} = 8; } | |
| case ("NWW") { $data{WindDirection} = 8.5; } | |
| else { $data{WindDirection} = 9; } | |
| } | |
| } elsif ($temp eq "QueryTime") { | |
| my $tempDate = substr($_,$indexValueStart,($indexValueEnd-$indexValueStart)-6); | |
| my $tempTime = substr($_,$indexValueEnd-5,5); | |
| $data{$temp} = str2time($tempDate . " 2011 " . $tempTime); | |
| } else { | |
| # not wind direction so just store it | |
| $data{$temp} = substr($_,$indexValueStart,$indexValueEnd-$indexValueStart); | |
| } | |
| #print substr($_,$indexValueStart,$indexValueEnd-$indexValueStart) . "\n"; | |
| $indexValue = index($_,"<td class=\"value\"",$indexValue+1); | |
| if ($indexValue == -1) { | |
| $indexValue = index($_,"id=\"timestamp\">",$indexValueEnd); | |
| } | |
| $n++; | |
| } | |
| $data{WindSpeedAvg} = ($data{WindSpeedHigh} + $data{WindSpeedLow}) / 2; | |
| ####### | |
| # now for the historical | |
| ####### | |
| $httpaddr = "http://www.weatheroffice.gc.ca/almanac/almanac_e.html?yyc"; | |
| my @units; | |
| do{ | |
| eval { | |
| local $SIG{ALRM} = sub { die "alarm\n" }; | |
| alarm $timeout; | |
| $tries++; | |
| $content = LWP::Simple::get($httpaddr); | |
| alarm 0; | |
| }; | |
| } while (!$content && $tries <= int($total_time / $timeout)); | |
| $data{Tries} = $tries; | |
| if (!$content) { | |
| exit(2); | |
| } | |
| # find the now table. | |
| $indexOfStart = index($content, "<table summary="); | |
| $indexOfEnd = index($content, "</table>", $indexOfStart); | |
| $_ = substr($content,$indexOfStart,$indexOfEnd - $indexOfStart); | |
| #print $_; | |
| #s/nbsp;/ /g; | |
| #s/<.+?>//g; | |
| #s/\s+/ /g; | |
| #whats on the site vs what do we want to output | |
| @keys = ("avg_max_temp","avg_min_temp","freq_precip","max_temp","min_temp","max_precip","max_rain","max_snowfall","max_snowOnGround"); | |
| @units = ("°C","°C","%","°C","°C","mm","mm","cm","cm"); | |
| $n = 0; | |
| $indexValue = index($_,"<td headers=\"header1 header", 0); | |
| for(; $indexValue != -1;) | |
| { | |
| my $indexValueStart = index($_,">",$indexValue)+1; | |
| my $indexValueEnd = index($_,$units[$n],$indexValue+2); | |
| my $temp = "hist_" . $keys[$n]; | |
| #print "debug: " . $temp . ":" .substr($_,$indexValueStart,$indexValueEnd-$indexValueStart); | |
| $data{$temp} = substr($_,$indexValueStart,$indexValueEnd-$indexValueStart); | |
| #print substr($_,$indexValueStart,$indexValueEnd-$indexValueStart) . "\n"; | |
| $indexValue = index($_,"<td headers=\"header1 header",$indexValue+1); | |
| $n++; | |
| } | |
| #### | |
| #output both now. | |
| #### | |
| for (keys %data) { | |
| printf "%s:%s ", $_, $data{$_}; | |
| } | |
| print "\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/perl | |
| #this file goes in your /scripts/ folder | |
| use warnings; | |
| use strict; | |
| use LWP::Simple; | |
| use Date::Parse; | |
| use Switch; | |
| my $timeout = 200; | |
| my $total_time = 36; | |
| my $httpaddr = "http://wx.ca/"; | |
| my $content; | |
| my $fail = 0; | |
| my $tries = 0; | |
| my %data; | |
| my %trash; | |
| my @keys; | |
| do{ | |
| eval { | |
| local $SIG{ALRM} = sub { die "alarm\n" }; | |
| alarm $timeout; | |
| $tries++; | |
| $content = LWP::Simple::get($httpaddr); | |
| alarm 0; | |
| }; | |
| } while (!$content && $tries <= int($total_time / $timeout)); | |
| $data{Tries} = $tries; | |
| if (!$content) { | |
| exit(2); | |
| } | |
| # find the now table. | |
| my $indexOfStart = index($content, "<table id=\"now\""); | |
| my $indexOfEnd = index($content, "</table></td>", $indexOfStart); | |
| my $_ = substr($content,$indexOfStart,$indexOfEnd - $indexOfStart); | |
| #s/nbsp;/ /g; | |
| #s/<.+?>//g; | |
| #s/\s+/ /g; | |
| @keys = ("Temperature","WindDirection","WindSpeedLow","WindSpeedHigh","BaroPressure","Preceipitation","Lightning","QueryTime"); | |
| my $n = 0; | |
| my $indexValue = index($_,"<td class=\"value\"", 0); | |
| for(; $indexValue != -1;) | |
| { | |
| my $indexValueStart = index($_,">",$indexValue)+1; | |
| my $indexValueEnd = index($_,"<",$indexValue+2); | |
| my $temp = $keys[$n]; | |
| #print "debug: " . $temp; | |
| if ($temp eq "WindDirection") { | |
| #god damned wind direction | |
| switch(substr($_,$indexValueStart,$indexValueEnd-$indexValueStart)) { | |
| case ("N") { $data{WindDirection} = 1; } | |
| case ("NNE") { $data{WindDirection} = 1.5; } | |
| case ("NE") { $data{WindDirection} = 2; } | |
| case ("NEE") { $data{WindDirection} = 2.5; } | |
| case ("E") { $data{WindDirection} = 3; } | |
| case ("SSE") { $data{WindDirection} = 3.5; } | |
| case ("SE") { $data{WindDirection} = 4; } | |
| case ("SEE") { $data{WindDirection} = 4.5; } | |
| case ("S") { $data{WindDirection} = 5; } | |
| case ("SSW") { $data{WindDirection} = 5.5; } | |
| case ("SW") { $data{WindDirection} = 6; } | |
| case ("SWW") { $data{WindDirection} = 6.5; } | |
| case ("W") { $data{WindDirection} = 7; } | |
| case ("NNW") { $data{WindDirection} = 7.5; } | |
| case ("NW") { $data{WindDirection} = 8; } | |
| case ("NWW") { $data{WindDirection} = 8.5; } | |
| else { $data{WindDirection} = 9; } | |
| } | |
| } elsif ($temp eq "QueryTime") { | |
| my $tempDate = substr($_,$indexValueStart,($indexValueEnd-$indexValueStart)-6); | |
| my $tempTime = substr($_,$indexValueEnd-5,5); | |
| $data{$temp} = str2time($tempDate . " 2011 " . $tempTime); | |
| } else { | |
| # not wind direction so just store it | |
| $data{$temp} = substr($_,$indexValueStart,$indexValueEnd-$indexValueStart); | |
| } | |
| #print substr($_,$indexValueStart,$indexValueEnd-$indexValueStart) . "\n"; | |
| $indexValue = index($_,"<td class=\"value\"",$indexValue+1); | |
| if ($indexValue == -1) { | |
| $indexValue = index($_,"id=\"timestamp\">",$indexValueEnd); | |
| } | |
| $n++; | |
| } | |
| $data{WindSpeedAvg} = ($data{WindSpeedHigh} + $data{WindSpeedLow}) / 2; | |
| ####### | |
| # now for the historical | |
| ####### | |
| $httpaddr = "http://www.weatheroffice.gc.ca/almanac/almanac_e.html?yyc"; | |
| my @units; | |
| do{ | |
| eval { | |
| local $SIG{ALRM} = sub { die "alarm\n" }; | |
| alarm $timeout; | |
| $tries++; | |
| $content = LWP::Simple::get($httpaddr); | |
| alarm 0; | |
| }; | |
| } while (!$content && $tries <= int($total_time / $timeout)); | |
| $data{Tries} = $tries; | |
| if (!$content) { | |
| exit(2); | |
| } | |
| # find the now table. | |
| $indexOfStart = index($content, "<table summary="); | |
| $indexOfEnd = index($content, "</table>", $indexOfStart); | |
| $_ = substr($content,$indexOfStart,$indexOfEnd - $indexOfStart); | |
| #print $_; | |
| #s/nbsp;/ /g; | |
| #s/<.+?>//g; | |
| #s/\s+/ /g; | |
| #whats on the site vs what do we want to output | |
| @keys = ("avg_max_temp","avg_min_temp","freq_precip","max_temp","min_temp","max_precip","max_rain","max_snowfall","max_snowOnGround"); | |
| @units = ("°C","°C","%","°C","°C","mm","mm","cm","cm"); | |
| $n = 0; | |
| $indexValue = index($_,"<td headers=\"header1 header", 0); | |
| for(; $indexValue != -1;) | |
| { | |
| my $indexValueStart = index($_,">",$indexValue)+1; | |
| my $indexValueEnd = index($_,$units[$n],$indexValue+2); | |
| my $temp = "hist_" . $keys[$n]; | |
| #print "debug: " . $temp . ":" .substr($_,$indexValueStart,$indexValueEnd-$indexValueStart); | |
| $data{$temp} = substr($_,$indexValueStart,$indexValueEnd-$indexValueStart); | |
| #print substr($_,$indexValueStart,$indexValueEnd-$indexValueStart) . "\n"; | |
| $indexValue = index($_,"<td headers=\"header1 header",$indexValue+1); | |
| $n++; | |
| } | |
| #### | |
| #output both now. | |
| #### | |
| for (keys %data) { | |
| printf "%s:%s ", $_, $data{$_}; | |
| } | |
| print "\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment