This site talks about the many challenges on computer programming.

The code below shows how can you retrieve a daily hardware report from opennms server, you can change this script to fetch the hardware report of several days without care if the current day is the first os last day of month because the date range is calculated in seconds and not based on math operations in day of month.

1234567891011121314151617181920212223242526272829

#!/bin/bash

#Just testing if the user has supplied the ip address of server #to get hardware statisticsif["$1d"!= "d"]; then

DAY=`date +%d`MONTH=`date +%m`YEAR=`date +%Y`

#Getting the number of seconds ellapsed at the end of #current dayTODAY=`date--date="$MONTH/$DAY/$YEAR 23:59:59" +%s`

#You can expand the date range by multiplying the number #of second in each day by number of daysDAY_START=`expr$TODAY - 86400`DAY_END=`expr$TODAY`

Currently you have JavaScript disabled. In order to post comments, please make sure JavaScript and Cookies are enabled, and reload the page.Click here for instructions on how to enable JavaScript in your browser.