The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Backup::Datto::Collection - Report status information on all of the Datto backup devices owned by an organization.

VERSION

This document describes DattoCollention version 0.1.1

SYNOPSIS

my $datto_collection = new Backup::Datto::Collection( 'dymr1gc0bvbinik88p5gkql4x4xexzkc' );

print $datto_collection->get_reboot_count() . " devices need a reboot\n"; print $datto_collection->get_failed_agents() . " agents failed their last backup\n"; print $datto_collection->get_behind_offsite() . " agents are behind for offsite\n"; print $datto_collection->get_offline() . " devices are offline\n"; print $datto_collection->get_behind_local() . " devices have not had a backup in 24 hours.\n";

DESCRIPTION

This module reports status information on all the Datto appliances in an MSPs fleet.

This came about from the need to feed status information on all of the devices to other monitoring tools for display purposes.

It handles the calculation for all of the items I wanted to initially display.

METHODS

new

Takes the API key (available from the partner portal) and fetches the XML configuration. This also processes the XML and prefills all of the values that the later functions return. Note that this means that values are not recalculated on subsequent calls to the get functions.

Returns undef if there was an error fetching the XML.

get_api_key

Returns the Datto API Key used during this session.

get_reboot_count

Returns the number of appliances that need a reboot. This is determined by the device being up for more than REBOOT_DURATION, a constant set to 30 days by by default. Future versions of this module will include the ability to modify this.

get_failed_agents

Returns the number of agents that failed their last backup.

get_num_dattos

Returns the number of appliances in the collection.

get_num_agents

Returns the number of agents in the collection

get_used_space

Returns a hash containing the used space of each device, by hostname

get_behind_offsite

Returns the number of agents that are behind on their offsite backup. This is determined by the agent not sending an image offsite for more than OFFSITE_THRESHOLD. By default, this is one week. Future versions of this module will include the ability to modify this.

get_behind_local

Returns the number of agent that are behind on local backups. This is determined by checking the last successful onsite backup. This is checked against the value of BACKUP_THRESHOLD which is set to 24 hours by default. Future versions of this module will include the ability to modify this.

get_offline

Returns the number of agents that are offline. This is determined by comparing the last checkin time with the current time and comparing the difference with OFFLINE_THRESHOLD. By default, this threshold is set to 1 hour. Future versions of this module will include the ability to modify this.

get_raw_xml

Returns the raw XML from Datto's API as a string. This can be used for diagnostic purposes, or to pass to other programs.

get_used_hash

Returns a hash containing the amount of used space, in KB, for each device. The keys are hostnames.

All other functions

All other functions in this module start with _priv and are designed to be use within the module itself. They are documented inline, but not part of the public interface. They are not guaranteed to remain in future releases. The public functions are guaranteed to remain.

CONFIGURATION

Baclup::Datto::Collection requires no configuration files or environment variables.

BUGS AND LIMITATIONS

This module assumes EST time. Future versions will handle devices in multiple time zones

This module does not handle NAS Shares at this time.

AUTHOR

Matthew Topper, topperm9@gmail.com

LICENSE AND COPYRIGHT

Copyright (C), Matthew Topper. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.