Can Graphite (whisper) metrics be aliased? - alias

There is a function named alias, that I tried as given below
http://myhost:80/render?target=alias(my.src.metrics.endTime,"my.target.metrics.success_endTime")
But I want to create my.target.metrics.success_endTime persistent in the graphite for my.src.metrics.endTime. so that new values under the my.src... are also available via my.target....

However, you can't configure persistent aliases in graphite's UI (webapp), you may create symbolic link on the filesystem, that will behave like an alias
./graphite/whisper/my$ ll
drwxr-xr-x 6 graphite graphite 4096 Dec 28 2016 src/
./graphite/whisper/my$ ln -s src target
./graphite/whisper/my$ ll
drwxr-xr-x 6 graphite graphite 4096 Dec 28 2016 src/
lrwxrwxrwx 1 root root 4 Dec 28 2016 target -> src/
Path my.target.* will be findable.
Other soltuion is to use different front/dashboard UI like Grafana and make use of variables - http://docs.grafana.org/reference/templating/

Related

SSH/Fuse mount create file ok but can't delete it

I have a proxmox server so under debian, and I want to mount a remote directory from my Nas Synologies to make backups.
I normally use ssh mounts without any problem.
But this time I have an error that I have never encountered, I can create files, but not delete them.
I find this very strange and I don't see where this can come from
root#proxmox:/mnt/# sshfs user#192.168.0.1:home/data /mnt/dist-folder/ -o reconnect,
ServerAliveInterval=60,ServerAliveCountMax=30,allow_other,
default_permissions,uid=0,gid=0,umask=007
root#proxmox:/mnt# cd dist-folder/
root#proxmox:/mnt/dist-folder# touch aa.txt
root#proxmox:/mnt/dist-folder# ls -la
total 12
drwxrwx--- 1 root root 114 Mar 13 09:53 .
drwxr-xr-x 7 root root 4096 Mar 13 09:37 ..
-rwxrwx--- 1 root root 0 Mar 13 09:53 aa.txt
root#proxmox:/mnt/dist-folder# rm aa.txt
rm: cannot remove 'aa.txt': Permission denied
With uid=0,gid=0 for root user and group
Thanks
This is finally a problem specific to synology.
For the assembly of the file it is absolutely necessary to respect the path by starting with
/homes/<user>home/
So it's give
sshfs user#192.168.0.1:/homes/proxmox/home/data /mnt/dist-folder/
And it's works fine !
It's not the first time that I have an abnormal configuration for this synology tool... AGrrrr

gitlab ci cache no matching files

I try to build apk with gitlab runner
When I build apk, I don't want download all build pacakage everytime
so i try to caching .gradle/caches and .gradle/wrappers
following is my gitlab-ci.yml
sdk_build_job
image: myimage:latest
stage: sdk-build
script:
...
cache:
key: gradle-cache
- /root/.gradle/caches
- /root/.gradle/wrapper
but create gradle-cache always make an warning
Creating cache gradle-cache...
WARNING: /root/.gradle/caches: no matching files
WARNING: /root/.gradle/wrapper: no matching files
Archive is up to date!
I don't know why can't find caches and wrapper directory
When i into docker container and find the folders, there were well positioned
root#runner-3d9fa57b-project-4-concurrent-0:~/.gradle# pwd
/root/.gradle
root#runner-3d9fa57b-project-4-concurrent-0:~/.gradle# ls -al
total 28
drwxr-xr-x 7 root root 4096 Dec 28 02:21 .
drwx------ 1 root root 4096 Dec 28 02:19 ..
drwxr-xr-x 6 root root 4096 Dec 28 02:20 caches
drwxr-xr-x 3 root root 4096 Dec 28 02:19 daemon
drwxr-xr-x 4 root root 4096 Dec 28 02:19 native
drwxr-xr-x 2 root root 4096 Dec 28 02:21 workers
drwxr-xr-x 3 root root 4096 Dec 28 02:19 wrapper
Please help me.......
That is because cache only works for files and folders INSIDE your project. This is poorly documented on the GitLab website IMHO.
So:
cache:
key: gradle-cache
paths:
- /root/.gradle/caches
- /root/.gradle/wrapper
Still only searches in:
/home/user/yourproject/root/.gradle/caches
/home/user/yourproject/root/.gradle/wrapper
For R, I set R_LIBS_SITE to a local folder inside my project. This allowed me to reuse installed packages. Have a look here.
I banged my head on the same issue.
MS Berends is partially right. Caching is supposed to work for files and folders only already within your project directory, see here: https://gitlab.com/gitlab-org/gitlab-ce/issues/4431
There were supposed to be an option of mounting the cache folder as a volume like
[[runners]]
name = ""
url = ""
token = ""
executor = "docker"
[runners.docker]
tls_verify = false
image = "alpine:latest"
privileged = true
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache", "/root/.gradle:/root/.gradle"]
shm_size = 0
But that does not work neither.
What I ended up doing is the following:
In my .gitlab-ci.yaml, I set the GRADLE_USER_HOME to point on the already mapped cache volume like
GRADLE_USER_HOME: "/cache/.gradle"
Then I passed that gradle home variable to the ./gradlew like
./gradlew $GRADLE_ARGS_CI -g $GRADLE_USER_HOME testDebugUnitTest
Notice the argument named $GRADLE_ARGS_CI. It is set to the following value
GRADLE_ARGS_CI: "--no-build-cache --no-daemon --stacktrace"
The --no-build-cache is necessary if you don't want to reuse the build outputs from previous builds. The --no-daemon is a no brainer because the docker build environment is spawned for every build.
I was able to save 2.5 min on my build time with these changes.
cache:
paths:
- .nuget
before_script:
- dotnet --version
- "[ -f .nuget/NuGet/NuGet.Config ] && rm -rf $HOME/.nuget || rsync -a $HOME/.nuget ./"
- ln -s $(pwd)/.nuget $HOME/.nuget

Cannot find the Nagios binary or no execute permissions in NagiosQL

I downloaded nagiosql_320.tar.gz and installed NagiosQL. When I click on check configuration file, it shows error as:
Cannot find the Nagios binary or no execute permissions!
I created symlink as below for nagios binary with following permission.
lrwxrwxrwx 1 root root 28 Jul 5 16:07 /usr/sbin/nagios -> /usr/local/nagios/bin/nagios
-rwxr-x--- 1 nagios apache 692624 Jun 27 14:40 /usr/local/nagios/bin/nagios
How can I correct the error?
chmod +x /usr/local/nagios/bin/nagios and try again

maxminddb module for apache 2.4 on ubuntu error: The MaxMind DB file contains invalid metadata

here is my system information:
$ apachectl -v
Server version: Apache/2.4.18 (Ubuntu)
Server built: 2016-07-14T12:32:26
$ cat /etc/*release* | grep -i dist
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.1 LTS"
$ uname -r
4.4.0-57-generic
i wish to install mod_maxminddb. i installed geoipupdate as a prerequisites and configured it to include not only geolite database, but either commercial one (using this)
$ ls -l /etc/GeoIP.conf
-rw-r--r-- 1 root root 818 Dec 24 18:29 /etc/GeoIP.conf
$ ls -l /usr/share/GeoIP/
total 0
$ geoipupdate
$ ls -l /usr/share/GeoIP/
total 187444
-rw-r--r-- 1 root root 112192399 Dec 24 18:46 GeoIP2-City.mmdb
-rw-r--r-- 1 root root 3012279 Dec 24 18:46 GeoIP2-Country.mmdb
-rw-r--r-- 1 root root 47721533 Dec 24 18:46 GeoIPCity.dat
-rw-r--r-- 1 root root 1699494 Dec 24 18:45 GeoIP.dat
-rw-r--r-- 1 root root 4189407 Dec 24 18:45 GeoIPISP.dat
-rw-r--r-- 1 root root 4299547 Dec 24 18:45 GeoLiteASNum.dat
-rw-r--r-- 1 root root 17760694 Dec 24 18:45 GeoLiteCity.dat
-rw-r--r-- 1 root root 1054583 Dec 24 18:45 GeoLiteCountry.dat
then complied and installed the mod_maxminddb, and when apache is configured to use the commercial databases, the following error is thrown
$ apachectl -M
AH00526: Syntax error on line 12 of /etc/apache2/mods-enabled/maxminddb.conf:
MaxMindDBFile: Failed to open /usr/share/GeoIP/GeoIPCity.dat: The MaxMind DB file contains invalid metadata
but that is not the case when apache is configured to use the geolite databases.
any ideas?
You didn't include your Apache config, but you appear to be trying to use mod_maxminddb with GeoIPCity.dat (GeoIP Legacy). It only works with GeoIP2. Adjust line 12 of maxminddb.conf to use GeoIP2-City.mmdb instead.

what is the difference between java-1.7.0-openjdk-i386 and java-7-openjdk-i386

when i install netbeans it gives me the option to select the java environment, i have 3 options, the oracle java and these two (java-1.7.0-openjdk-i386 and java-7-openjdk-i386). what is the difference between these two?The os if ubuntu.
The two OpenJDK are same. However OpenJDK is slightly different from Oracle JDK. Read this post for more clarification.
The reason why you are getting two options for OpenJDK is PROBABLY that you have two copies of OpenJDK installed (or two different references to the same directory on your system.)
For further investigation, try to ls -lh /usr/lib/jvm. The /usr/lib/jvm is usually the directory where Java gets installed. Check if one of them is a symbolic link. Also, check in netbeans the location of the two JDK and see if in fact you have two versions or references of Java on the system.
For example, here is the output of ls -lh on my system:
ls -lh
total 24K
lrwxrwxrwx 1 root root 26 Sep 10 13:41 default-java -> /usr/lib/jvm/java-7-oracle
lrwxrwxrwx 1 root root 18 Mar 13 2012 java-1.5.0-gcj -> java-1.5.0-gcj-4.6
drwxr-xr-x 7 root root 4.0K Aug 22 2012 java-1.5.0-gcj-4.6
lrwxrwxrwx 1 root root 19 Jun 26 2012 java-1.6.0-openjdk-i386 -> java-6-openjdk-i386
drwxr-xr-x 3 root root 4.0K Feb 15 10:52 java-6-openjdk-common
drwxr-xr-x 7 root root 4.0K Feb 15 10:52 java-6-openjdk-i386
drwxr-xr-x 8 ankit ankit 4.0K Jun 6 2012 java-6-sun
drwxr-xr-x 5 root root 4.0K Aug 22 2012 java-7-openjdk-i386
drwxr-xr-x 8 root root 4.0K Feb 20 10:40 java-7-oracle
lrwxrwxrwx 1 root root 12 Mar 13 2012 java-gcj -> java-gcj-4.6
lrwxrwxrwx 1 root root 18 Apr 16 2012 java-gcj-4.6 -> java-1.5.0-gcj-4.6
As you can see java-1.6.0-openjdk-i386 is just a symbolic link/reference to another directory named java-6-openjdk-i386
You installed it twice
From openjdk, following instructions from here
sudo apt-get install openjdk-7-jdk
From Stackoverflow, following instructions from here
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
Would recommend the second one and remvong the first one by typing
sudo apt-get remove openjdk-7-jdk.