Graph nan after creating Data Input Method

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
yellowdog2
Posts: 34
Joined: Tue Jun 08, 2010 9:11 am

Graph nan after creating Data Input Method

Post by yellowdog2 »

Hello,

I wanted to graph users from a specific application runing on a linux server.

I created a shell script working fin and returning an integer value.

I then created a Data Input Method for the server to graph, next a Data Template and a Graph Template following the http://docs.cacti.net/manual:088:3a_adv ... put_method article.

I added the graph Template in my device but the graph remains blank with NAN.

I have already done such a graph Template for a Windows server and did not encounter any problem.

How to troubleshoot that problem? I'd like to check each step of the creation but don't know how.

Any help is appreciated.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Graph nan after creating Data Input Method

Post by netniV »

Enable device debug logging for the device in question and then show the logs for the output of that script.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
yellowdog2
Posts: 34
Joined: Tue Jun 08, 2010 9:11 am

Re: Graph nan after creating Data Input Method

Post by yellowdog2 »

What do you mean by "Enable device debug logging for the device" ?

i don't know how to set it ....

Below is the debug result for the graph:
RRDTool Command:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title='VLNXDIAP2 - DIAPASON users counter GT' \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label= \
--slope-mode \
--font TITLE:10: \
--font AXIS:7: \
--font LEGEND:8: \
--font UNIT:7: \
DEF:a="/usr/share/cacti/rra/vlnxdiap2_diap_users_counter_506.rrd":DIAP_users_counter:AVERAGE \
AREA:a#4444FFFF:"Diapason Working users" \
GPRINT:a:LAST:"Current\:%8.2lf %s" \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:a:MAX:"Maximum\:%8.2lf %s\n"

RRDTool Says:
OK
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Graph nan after creating Data Input Method

Post by netniV »

Edit the device in question, click on the Enable Device Debug.

You can also do this within Settings, by entering the ID in the Selected Device Debug box.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
yellowdog2
Posts: 34
Joined: Tue Jun 08, 2010 9:11 am

Re: Graph nan after creating Data Input Method

Post by yellowdog2 »

I must be blind or something like this but nothing related to debug in the settings nor in the edit device.

Do you have a snapshot to enlight me ?
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Graph nan after creating Data Input Method

Post by netniV »

Wait a sec, what version are you running on?
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
yellowdog2
Posts: 34
Joined: Tue Jun 08, 2010 9:11 am

Re: Graph nan after creating Data Input Method

Post by yellowdog2 »

Version 0.8.7h
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Graph nan after creating Data Input Method

Post by netniV »

Oh, in that case... I'm not going to be much help. I really only know the 1.x code. I'm not sure if there was a device debug on that version.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
tertius
Cacti User
Posts: 82
Joined: Wed Mar 01, 2017 2:34 pm

Re: Graph nan after creating Data Input Method

Post by tertius »

In 0.8.x, you can only globally enable debug logging. You do this in cacti settings. Set the log level to debug. The challenge is to find your devices' logs in the heap of debug messages of all the other devices.
yellowdog2
Posts: 34
Joined: Tue Jun 08, 2010 9:11 am

Re: Graph nan after creating Data Input Method

Post by yellowdog2 »

I found the origin of the problem: in the cacti log file, I have the folowing messages.

/usr/share/cacti/scripts/check_VLNXDIAP_working_users.pl 128.1.110.130, output: Remote command execution failed: Could not create directory '/usr/share/cacti/.ssh'.
Then I created the .ssh directory, but now I have this.
/usr/share/cacti/scripts/check_VLNXDIAP_working_users.pl 128.1.110.130, output: Remote command execution failed: Host key verification failed.
I copied the content of the /root/.ssh in /usr/share/cacti/.ssh because my remote server is declared in the known_hosts file and the rsa keys also

What do I have to do more ? It is strange that cacti needs his own .ssh files and directory, why not using the /root/.ssh ?
yellowdog2
Posts: 34
Joined: Tue Jun 08, 2010 9:11 am

Re: Graph nan after creating Data Input Method

Post by yellowdog2 »

After changing the owner of the file to cacti:apache it works now!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Graph nan after creating Data Input Method

Post by netniV »

Yes, if you copied that from root, only root would have had privilege to the file. The folder and contents of .ssh must be readable only to the user who is the owner (eg, 600 for files and 700 for directories).
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests