3

Can't locate DateTime.pm in @INC (you may need to install the DateTime module)

I have installed DateTime module with these commands

perl -MCPAN -e shell
cpan> install DateTime

To find out where DateTime was installed I used this command

perldoc -ml DateTime

But the result was no module found for "DateTime"

Gopi
  • 620
  • 8
  • 16
Rifath
  • 31
  • 1
  • 3

3 Answers3

1

For Installing Lib DateTime on perl just type

sudo apt-get install libdatetime-perl
Soroosh Gholami
  • 130
  • 2
  • 10
0

For the Cloudwatch agent at least, make sure to install libwww-perl and libdatetime-perl

Source: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/mon-scripts.html#mon-scripts-perl_prereq

  • 1
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – borchvm Oct 30 '19 at 10:58
0

If you are installing monitoring scripts for cloudwatch agent. These are the steps needed for Ubuntu

  1. Install required Packages
sudo apt-get install unzip
sudo apt-get install libwww-perl libdatetime-perl

This might be the command you missed to execute, this will install the required perl packages

  1. Download monitoring scripts
curl https://aws-cloudwatch.s3.amazonaws.com/downloads/CloudWatchMonitoringScripts-1.2.2.zip -O
  1. Extract the files
unzip CloudWatchMonitoringScripts-1.2.2.zip && \
rm CloudWatchMonitoringScripts-1.2.2.zip && \
cd aws-scripts-mon
  1. Do the IAM role configuration for your instance or create awscreds.conf file with your credentials

  2. Do a test run

./mon-put-instance-data.pl --mem-util --verify --verbose
sks147
  • 196
  • 2
  • 8