how to use --last-period ?

8 posts / 0 new
Last post
#1 Wed, 08/03/2011 - 10:01
SoftDux

how to use --last-period ?

Hi,

Does anyone know how to actually use "--last-period" when trying to gather stats on CloudMin Virtual Machines via the commandline?

The documentation (http://www.virtualmin.com/documentation/cloudmin/devel/cli/list_systems) is a bit vague on this:

[quote] In mutiline mode, uptime, CPU and RAM usage is displayed for the current account period. To show the previous period instead, use the --last-period flag. Or to select any period in the past, use the --period-ago flag followed by a number of weeks or months. [/quote]

But, none of this works: --last-period July --last-period July2011 --last-period 201107 --last-period 1month

Wed, 08/03/2011 - 10:11
andreychek

Howdy,

The --last-period option doesn't take a parameter... it means specifically, the "last" or "previous" period. To use that, you could use something like this syntax:

cloudmin list-systems --multiline --last-period

To specify what period to use, and not just use the last period, you could look into the "--period-ago" parameter.

-Eric

Wed, 08/03/2011 - 10:17
SoftDux

Hi Eric,

Ok, let's say I want stats for July, what command & syntax should I then use?

Wed, 08/03/2011 - 10:23
andreychek

The time periods are all relative to now... you could use something like this:

cloudmin list-systems --multiline --period-ago "1 month"

Wed, 08/03/2011 - 10:29
SoftDux

thanx.

Now for the technical question:

Is this literally one month ago, i.e. from 3rd June to 3rd July, or is it actually last month, i.e. 1July - 31st July?

Wed, 08/03/2011 - 10:33
SoftDux

Ok, I see now.

It's basically from the 1st day of last month to the 1st day of this month:

[/quote] Start of period: 01/Jul/2011 00:00 (2915850 seconds ago) End of period: 01/Aug/2011 00:00 (237450 seconds ago) [/quote]

So I presume it's safe to say that it captures the whole of last month's usage?

Wed, 08/03/2011 - 10:38
andreychek

Well, it appears to be showing the period that was active 1 month ago from today.

In the output, you should see something like this:

    Start of period: 01/Jul/2011 00:00 (2914606 seconds ago)
    End of period: 01/Aug/2011 00:00 (236206 seconds ago)

Although today is Aug 3, it's not showing a period beginning on July 3, it's showing the period beginning on July 1.

-Eric

Wed, 08/03/2011 - 10:39
andreychek

So I presume it's safe to say that it captures the whole of last month's usage?

Yeah, I'd assume you're seeing data from what it lists as the "Start of period" through the "End of period".

-Eric

Topic locked